lib/gurke/reporters/team_city_reporter.rb in gurke-3.1.0 vs lib/gurke/reporters/team_city_reporter.rb in gurke-3.2.0
- old
+ new
@@ -12,16 +12,23 @@
super
end
def before_scenario(scenario)
@status_reported = false
+ @retry = false
publish :testStarted, name: scenario.name
super
end
+ def retry_scenario(scenario)
+ @retry = true
+
+ super
+ end
+
def after_scenario(scenario)
publish :testFinished, name: scenario.name
super
end
@@ -43,21 +50,28 @@
end
def step_failed(step, *args)
super(step, *args, exception: false)
- report :testFailed,
- name: step.scenario.name,
- message: step.exception.inspect,
- backtrace: step.exception.backtrace.join('\n')
+ unless step.scenario.retryable? && !retry?
+ # do not report test as failed if it will be retries
+ report :testFailed,
+ name: step.scenario.name,
+ message: step.exception.inspect,
+ backtrace: step.exception.backtrace.join('\n')
+ end
print_exception(step.exception)
end
private
def status_reported?
@status_reported
+ end
+
+ def retry?
+ @retry
end
def report(*args)
return if status_reported?