Class: ReportPortal::Cucumber::ParallelFormatter
- Defined in:
- lib/report_portal/cucumber/parallel_formatter.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ ParallelFormatter
constructor
private
A new instance of ParallelFormatter.
Methods inherited from Formatter
#embed, #on_test_run_finished, #puts
Constructor Details
#initialize(config) ⇒ ParallelFormatter
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ParallelFormatter.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/report_portal/cucumber/parallel_formatter.rb', line 29 def initialize(config) ENV['REPORT_PORTAL_USED'] = 'true' @queue = Queue.new @thread = Thread.new do @report = ReportPortal::Cucumber::ParallelReport.new loop do method_arr = @queue.pop @report.public_send(*method_arr) end end @thread.abort_on_exception = true @io = config.out_stream [:test_case_started, :test_case_finished, :test_step_started, :test_step_finished].each do |event_name| config.on_event event_name do |event| @queue.push([event_name, event, ReportPortal.now]) end end config.on_event :test_run_finished, &method(:on_test_run_finished) end |