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.



7
8
9
# File 'lib/gitlab/qa/report/prepare_stage_reports.rb', line 7

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



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

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