Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test_report_summary.rb « reports « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3e7227b722391b21134ed8c1ad6a35691adb48c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module Gitlab
  module Ci
    module Reports
      class TestReportSummary
        def initialize(build_report_results)
          @build_report_results = build_report_results
          @suite_summary = TestSuiteSummary.new(@build_report_results)
        end

        def total
          @suite_summary.to_h
        end

        def test_suites
          @build_report_results
            .group_by(&:tests_name)
            .transform_values { |results| TestSuiteSummary.new(results) }
        end
      end
    end
  end
end