Sha256: 896478d258d451227bb3538af0ccd87f6dae41e7e1c33f846ba64e4254a3cd15

Contents?: true

Size: 837 Bytes

Versions: 8

Compression:

Stored size: 837 Bytes

Contents

class TestRunsController < ApplicationController
  before_filter :find_test_run

  def show
    @title = "Test Results for #{@test_run.sha[0...8]}"
    render template: "project_notification/test_run"
  end

  def confirm_retry
  end

  def retry
    @test_run.retry!

    build_url = if @project.ci_server.respond_to? :last_build_progress_url
      @project.ci_server.last_build_progress_url
    elsif @project.ci_server.respond_to? :last_build_url
      @project.ci_server.last_build_url
    end

    if build_url
      redirect_to build_url
    else
      redirect_to root_url, notice: "Build for #{@project.name} retried"
    end
  end

private

  def find_test_run
    @project = Project.find_by_slug!(params[:slug])
    @test_run = @project.test_runs.find_by_sha(params[:commit]) || (raise ActiveRecord::RecordNotFound)
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
houston-core-0.6.0 app/controllers/test_runs_controller.rb
houston-core-0.5.6 app/controllers/test_runs_controller.rb
houston-core-0.5.5 app/controllers/test_runs_controller.rb
houston-core-0.5.4 app/controllers/test_runs_controller.rb
houston-core-0.5.3 app/controllers/test_runs_controller.rb
houston-core-0.5.2 app/controllers/test_runs_controller.rb
houston-core-0.5.1 app/controllers/test_runs_controller.rb
houston-core-0.5.0 app/controllers/test_runs_controller.rb