Class: TestRunsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/test_runs_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#after_sign_in_path_for, #api_authenticate!, #current_project, #expire_revision!, #followed_projects, #no_cache, #read_revision, #require_login, #return_or_cache_revision!, #revision, #save_current_project, #set_current_project, #unfurling?

Methods included from UrlHelper

#feature_path, #github_commit_range_url, #github_commit_url, #github_project_url, #github_url?, #goldmine_case_number_url, #link_to_project_feature, #new_release_url, #releases_path

Instance Method Details

#confirm_retryObject



10
11
# File 'app/controllers/test_runs_controller.rb', line 10

def confirm_retry
end

#retryObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/test_runs_controller.rb', line 13

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

#save_resultsObject



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/controllers/test_runs_controller.rb', line 29

def save_results
  results_url = params[:results_url]

  if results_url.blank?
    message = "#{@project.ci_server_name} is not appropriately configured to build #{@project.name}."
    additional_info = "#{@project.ci_server_name} did not supply 'results_url' when it triggered the post_build hook"
    ProjectNotification.ci_configuration_error(@test_run, message, additional_info: additional_info).deliver!
    return
  end

  @test_run.completed!(results_url)
  head :ok
end

#showObject



5
6
7
8
# File 'app/controllers/test_runs_controller.rb', line 5

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