From da7e430692327019739e7e56e0bd2ad65ffd438a Mon Sep 17 00:00:00 2001 From: Katarzyna Treder Date: Tue, 7 Jan 2025 15:18:46 +0100 Subject: [PATCH] Add unique test identifier to be able to manage logs Signed-off-by: Katarzyna Treder --- test/functional/test-framework | 2 +- test/functional/tests/conftest.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/functional/test-framework b/test/functional/test-framework index f7f2914e4..9789af579 160000 --- a/test/functional/test-framework +++ b/test/functional/test-framework @@ -1 +1 @@ -Subproject commit f7f2914e41ce73d13dafe6cd749aa6e2d33b4315 +Subproject commit 9789af579172452bf2dbbfa310545ae283e50c1a diff --git a/test/functional/tests/conftest.py b/test/functional/tests/conftest.py index 2e42d242b..891482136 100644 --- a/test/functional/tests/conftest.py +++ b/test/functional/tests/conftest.py @@ -77,6 +77,7 @@ def pytest_runtest_setup(item): test_name = item.name.split("[")[0] TestRun.LOGGER = create_log(item.config.getoption("--log-path"), test_name) + TestRun.LOGGER.unique_test_identifier = f"TEST__{item.name}__random_seed_{TestRun.random_seed}" duts = item.config.getoption("--dut-config") required_duts = next(item.iter_markers(name="multidut"), None) @@ -122,6 +123,8 @@ def pytest_runtest_setup(item): f"Exception occurred during test setup:\n{str(ex)}\n{traceback.format_exc()}" ) + TestRun.LOGGER.print_test_identifier_to_logs() + TestRun.usr = Opencas( repo_dir=os.path.join(os.path.dirname(__file__), "../../.."), working_dir=dut_config["working_dir"],