Class: Gitlab::Ci::Reports::TestFailureHistory

Inherits:
Object
  • Object
show all
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/ci/reports/test_failure_history.rb

Instance Method Summary collapse

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

#initialize(failed_junit_tests, project) ⇒ TestFailureHistory

Returns a new instance of TestFailureHistory.


9
10
11
12
# File 'lib/gitlab/ci/reports/test_failure_history.rb', line 9

def initialize(failed_junit_tests, project)
  @failed_junit_tests = build_map(failed_junit_tests)
  @project = project
end

Instance Method Details

#load!Object


14
15
16
17
18
# File 'lib/gitlab/ci/reports/test_failure_history.rb', line 14

def load!
  recent_failures_count.each do |key_hash, count|
    failed_junit_tests[key_hash].set_recent_failures(count, project.default_branch_or_main)
  end
end