From 38314003cf2abd51824389279bbd424ee20d4ef0 Mon Sep 17 00:00:00 2001 From: monusingh-1 Date: Thu, 21 Sep 2023 18:05:04 +0530 Subject: [PATCH] Test Recorder fix Signed-off-by: monusingh-1 --- src/test_workflow/test_cluster.py | 2 +- src/test_workflow/test_recorder/test_recorder.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test_workflow/test_cluster.py b/src/test_workflow/test_cluster.py index b531d012d2..55eeb44734 100644 --- a/src/test_workflow/test_cluster.py +++ b/src/test_workflow/test_cluster.py @@ -106,7 +106,7 @@ def __save_test_result_data(self, termination_result: ServiceTerminationResult) termination_result.log_files ) - self.save_logs.save_test_result_data(test_result_data) + # self.save_logs.save_test_result_data(test_result_data) @property def endpoint(self) -> str: diff --git a/src/test_workflow/test_recorder/test_recorder.py b/src/test_workflow/test_recorder/test_recorder.py index d7e2ddf2a1..17a871d21c 100644 --- a/src/test_workflow/test_recorder/test_recorder.py +++ b/src/test_workflow/test_recorder/test_recorder.py @@ -91,14 +91,20 @@ def _copy_log_files(self, log_files: dict, dest_directory: str) -> None: class LocalClusterLogs(LogRecorder): + parent_class: TestRecorder + + def __init__(self, parent_class: TestRecorder) -> None: self.parent_class = parent_class + self.number_of_nodes = 0 + def save_test_result_data(self, test_result_data: TestResultData) -> None: base = self.parent_class._create_base_folder_structure(test_result_data.component_name, test_result_data.component_test_config) - dest_directory = os.path.join(base, "local-cluster-logs") + dest_directory = os.path.join(base, "local-cluster-logs/" + str(self.number_of_nodes)) + self.number_of_nodes += 1 os.makedirs(dest_directory, exist_ok=True) logging.info( f"Recording local cluster logs for {test_result_data.component_name} with test configuration as "