Skip to content

Commit

Permalink
ruby agent works with cucumber 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliaksandr Trush committed Jan 4, 2018
1 parent 35256fd commit 333beb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/report_portal/cucumber/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def initialize(config)
@queue.push([event_name, event, ReportPortal.now])
end
end
config.on_event :test_run_finished, &method(:done)
end

def puts(message)
Expand All @@ -56,8 +57,7 @@ def embed(*args)
@queue.push([:embed, *args, ReportPortal.now])
end

# @api private
def done
def done(_event)
@queue.push([:done, ReportPortal.now])
sleep 0.03 while !@queue.empty? || @queue.num_waiting == 0 # TODO: how to interrupt launch if the user aborted execution
@thread.kill
Expand Down
4 changes: 2 additions & 2 deletions lib/report_portal/cucumber/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_step_started(event, desired_time = ReportPortal.now)
test_step = event.test_step
if step?(test_step) # `after_test_step` is also invoked for hooks
step_source = test_step.source.last
message = "-- #{step_source.keyword}#{step_source.name} --"
message = "-- #{step_source.keyword}#{step_source.text} --"
if step_source.multiline_arg.doc_string?
message << %(\n"""\n#{step_source.multiline_arg.content}\n""")
elsif step_source.multiline_arg.data_table?
Expand All @@ -114,7 +114,7 @@ def test_step_finished(event, desired_time = ReportPortal.now)
ex = result.exception
sprintf("%s: %s\n %s", ex.class.name, ex.message, ex.backtrace.join("\n "))
else
sprintf("Undefined step: %s:\n%s", test_step.name, test_step.source.last.backtrace_line)
sprintf("Undefined step: %s:\n%s", test_step.text, test_step.source.last.backtrace_line)
end
ReportPortal.send_log(:error, exception_info, time_to_send(desired_time))
end
Expand Down

0 comments on commit 333beb4

Please sign in to comment.