From b9b49aeacabb5170e8736aa13e867ce17592a9e9 Mon Sep 17 00:00:00 2001 From: Benedikt Haas Date: Mon, 5 Feb 2024 13:58:25 +0100 Subject: [PATCH 1/2] return status of scenario as final result --- scenario_runner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scenario_runner.py b/scenario_runner.py index 18ac73147..ffe12bef3 100755 --- a/scenario_runner.py +++ b/scenario_runner.py @@ -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): """ @@ -427,7 +429,7 @@ 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() @@ -435,8 +437,6 @@ def _load_and_run_scenario(self, config): 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) From 783b4d53d2c55aaf0b09d2d408c45c39bc68b2a1 Mon Sep 17 00:00:00 2001 From: Benedikt Haas Date: Mon, 5 Feb 2024 14:10:52 +0100 Subject: [PATCH 2/2] add note to changelog --- CARLOS_CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CARLOS_CHANGELOG.md b/CARLOS_CHANGELOG.md index 361487ae5..598ac5dd4 100644 --- a/CARLOS_CHANGELOG.md +++ b/CARLOS_CHANGELOG.md @@ -11,3 +11,4 @@ ### Minor changes * Small fix related to CARLA autopilot +* Modified `scenario_runner.py` to return the result of scenario execution as exit code