Class: Gitlab::QA::Report::PrepareStageReports

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/qa/report/prepare_stage_reports.rb

Instance Method Summary collapse

Constructor Details

#initialize(input_files:) ⇒ PrepareStageReports

Returns a new instance of PrepareStageReports.



9
10
11
# File 'lib/gitlab/qa/report/prepare_stage_reports.rb', line 9

def initialize(input_files:)
  @input_files = input_files
end

Instance Method Details

#invoke!Object

Create a new JUnit report file for each Stage, containing tests from that Stage alone



14
15
16
17
18
19
20
21
22
# File 'lib/gitlab/qa/report/prepare_stage_reports.rb', line 14

def invoke!
  collate_test_cases(@input_files).each do |stage, tests|
    filename = "#{stage}.xml"

    File.write(filename, new_junit_report(tests))

    puts "Saved #{filename}"
  end
end