Class: Ci::BuildReportResultService

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Utils::UsageData
Defined in:
app/services/ci/build_report_result_service.rb

Constant Summary collapse

EVENT_NAME =
'i_testing_test_case_parsed'

Constants included from Gitlab::Utils::UsageData

Gitlab::Utils::UsageData::DISTRIBUTED_HLL_FALLBACK, Gitlab::Utils::UsageData::FALLBACK, Gitlab::Utils::UsageData::HISTOGRAM_FALLBACK, Gitlab::Utils::UsageData::MAX_BUCKET_SIZE

Instance Method Summary collapse

Methods included from Gitlab::Utils::UsageData

#add, #add_metric, #alt_usage_data, #count, #distinct_count, #epics_deepest_relationship_level, #estimate_batch_distinct_count, #histogram, #jira_integration_data, #maximum_id, #measure_duration, #minimum_id, #redis_usage_data, #sum, #track_usage_event, #with_duration, #with_finished_at, #with_prometheus_client

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Instance Method Details

#execute(build) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/services/ci/build_report_result_service.rb', line 9

def execute(build)
  return unless build.has_test_reports?

  test_suite = generate_test_suite_report(build)

  track_test_cases(build, test_suite)

  build.report_results.create!(
    project_id: build.project_id,
    data: tests_params(test_suite)
  )
end