Fix log summary to include the full log dir path

Previously, the log path displayed only the base directory (e.g.,
'/home/<user>/AUTOMATION_LOGS'). Now, it shows the full path, including
dynamically derived details such as the lab name and timestamp
(e.g., '/home/<user>/AUTOMATION_LOGS/<dynamic_lab_name>/<timestamp>').

The lab name is extracted from the configuration file
(config/lab/files/default.json5), ensuring the log paths reflect the
specific lab and execution context.

Change-Id: I3aa0ed8431b3a94bb8c36b90bdad5aab336add7f
Signed-off-by: Andrew Vaillancourt <andrew.vaillancourt@windriver.com>
This commit is contained in:
Andrew Vaillancourt
2025-01-09 03:14:44 -05:00
parent 167343c6a2
commit 0cbd27ec25

View File

@@ -37,12 +37,17 @@ def execute_test(test: TestCase, test_executor_summary: TestExecutorSummary, tes
def log_summary(test_executor_summary: TestExecutorSummary):
"""
Logs the test summary
Logs the summary of test execution results and the path to the log directory.
This function processes the test summary provided by `TestExecutorSummary`, logs each
line of the summary, and logs the location of the log directory.
Args:
test_executor_summary (): the summary object containing the results
test_executor_summary (TestExecutorSummary): The summary object containing the test
execution results.
Returns:
None
"""
get_logger().log_info("")
get_logger().log_info("")
@@ -50,7 +55,7 @@ def log_summary(test_executor_summary: TestExecutorSummary):
for summary_line in test_executor_summary.get_tests_summary():
get_logger().log_info(summary_line)
get_logger().log_info("")
get_logger().log_info(f"Logs Path: {ConfigurationManager.get_logger_config().get_log_location()}")
get_logger().log_info(f"Logs Path: {get_logger().get_log_folder()}")
def main():