diff --git a/envs/monkey_zoo/blackbox/tests/performance/telem_sample_parsing/sample_file_parser.py b/envs/monkey_zoo/blackbox/tests/performance/telem_sample_parsing/sample_file_parser.py index f12704d2d..70e25d8e7 100644 --- a/envs/monkey_zoo/blackbox/tests/performance/telem_sample_parsing/sample_file_parser.py +++ b/envs/monkey_zoo/blackbox/tests/performance/telem_sample_parsing/sample_file_parser.py @@ -30,8 +30,12 @@ class SampleFileParser: @staticmethod def read_telem_files() -> List[str]: telems = [] - file_paths = [path.join(TELEM_DIR_PATH, f) for f in listdir(TELEM_DIR_PATH) - if path.isfile(path.join(TELEM_DIR_PATH, f))] + try: + file_paths = [path.join(TELEM_DIR_PATH, f) for f in listdir(TELEM_DIR_PATH) + if path.isfile(path.join(TELEM_DIR_PATH, f))] + except FileNotFoundError: + raise FileNotFoundError("Telemetries to send not found. " + "Refer to readme to figure out how to generate telemetries and where to put them.") for file_path in file_paths: with open(file_path, 'r') as telem_file: telem_string = "".join(telem_file.readlines()).replace("\n", "") diff --git a/envs/monkey_zoo/blackbox/tests/performance/telemetry_performance_test.py b/envs/monkey_zoo/blackbox/tests/performance/telemetry_performance_test.py index 5fc97d222..4de77e41a 100644 --- a/envs/monkey_zoo/blackbox/tests/performance/telemetry_performance_test.py +++ b/envs/monkey_zoo/blackbox/tests/performance/telemetry_performance_test.py @@ -26,9 +26,8 @@ class TelemetryPerformanceTest: try: all_telemetries = SampleFileParser.get_all_telemetries() except FileNotFoundError: - LOGGER.error("Telemetries to send not found. Refer to readme to figure out how to generate telemetries " - "and where to put them.") - return False + raise FileNotFoundError("Telemetries to send not found. " + "Refer to readme to figure out how to generate telemetries and where to put them.") LOGGER.info("Telemetries imported successfully.") all_telemetries.sort(key=lambda telem: telem['time']['$date']) telemetry_parse_times = {}