Class: Megatest::Reporters::JUnitReporter

Inherits:
AbstractReporter show all
Defined in:
lib/megatest/reporters.rb

Instance Method Summary collapse

Methods inherited from AbstractReporter

#after_test_case, #before_test_case, #initialize, #start

Constructor Details

This class inherits a constructor from Megatest::Reporters::AbstractReporter

Instance Method Details

#summary(executor, _queue, summary) ⇒ Object



199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/megatest/reporters.rb', line 199

def summary(executor, _queue, summary)
  @depth = 0
  @out.puts(%{<?xml version="1.0" encoding="UTF-8"?>})

  results_by_suite = summary.results.map { |r| r.test_id.split("#", 2) << r }.group_by(&:first)

  tag(:testsuites, { time: executor.wall_time }) do
    results_by_suite.each do |testsuite, named_results|
      render_test_suite(testsuite, named_results)
    end
  end
end