Sha256: 16847c2e996b999c597fdaa3f3f80119e08198301a6ba51e431c63508a1f2756

Contents?: true

Size: 857 Bytes

Versions: 1

Compression:

Stored size: 857 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

1 entries across 1 versions & 1 rubygems

Version Path
houston-core-0.5.0.beta1 app/controllers/test_runs_controller.rb