Skip to content

Commit

Permalink
return status of scenario as final result
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Haas committed Feb 5, 2024
1 parent 6f08e0f commit b9b49ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scenario_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,12 @@ def _analyze_scenario(self, config):

if not self.manager.analyze_scenario(self._args.output, filename, junit_filename, json_filename):
print("All scenario tests were passed successfully!")
return True
else:
print("Not all scenario tests were successful")
if not (self._args.output or filename or junit_filename):
print("Please run with --output for further information")
return False

def _record_criteria(self, criteria, name):
"""
Expand Down Expand Up @@ -427,16 +429,14 @@ def _load_and_run_scenario(self, config):
self.manager.run_scenario()

# Provide outputs if required
self._analyze_scenario(config)
result = self._analyze_scenario(config)

# Remove all actors, stop the recorder and save all criterias (if needed)
scenario.remove_all_actors()
if self._args.record:
self.client.stop_recorder()
self._record_criteria(self.manager.scenario.get_criteria(), recorder_name)

result = True

except Exception as e: # pylint: disable=broad-except
traceback.print_exc()
print(e)
Expand Down

0 comments on commit b9b49ae

Please sign in to comment.