Class: Gitlab::Ci::Reports::TestReportsComparer
- Inherits:
-
Object
- Object
- Gitlab::Ci::Reports::TestReportsComparer
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/ci/reports/test_reports_comparer.rb
Instance Attribute Summary collapse
-
#base_reports ⇒ Object
readonly
Returns the value of attribute base_reports.
-
#head_reports ⇒ Object
readonly
Returns the value of attribute head_reports.
Instance Method Summary collapse
-
#initialize(base_reports, head_reports) ⇒ TestReportsComparer
constructor
A new instance of TestReportsComparer.
- #suite_comparers ⇒ Object
- #total_status ⇒ Object
Constructor Details
#initialize(base_reports, head_reports) ⇒ TestReportsComparer
Returns a new instance of TestReportsComparer.
11 12 13 14 |
# File 'lib/gitlab/ci/reports/test_reports_comparer.rb', line 11 def initialize(base_reports, head_reports) @base_reports = base_reports || TestReport.new @head_reports = head_reports end |
Instance Attribute Details
#base_reports ⇒ Object (readonly)
Returns the value of attribute base_reports.
9 10 11 |
# File 'lib/gitlab/ci/reports/test_reports_comparer.rb', line 9 def base_reports @base_reports end |
#head_reports ⇒ Object (readonly)
Returns the value of attribute head_reports.
9 10 11 |
# File 'lib/gitlab/ci/reports/test_reports_comparer.rb', line 9 def head_reports @head_reports end |
Instance Method Details
#suite_comparers ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/gitlab/ci/reports/test_reports_comparer.rb', line 16 def suite_comparers strong_memoize(:suite_comparers) do head_reports.test_suites.map do |name, test_suite| TestSuiteComparer.new(name, base_reports.get_suite(name), test_suite) end end end |
#total_status ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/gitlab/ci/reports/test_reports_comparer.rb', line 24 def total_status if suite_comparers.any? { |suite| suite.total_status == TestCase::STATUS_FAILED } TestCase::STATUS_FAILED else TestCase::STATUS_SUCCESS end end |