Skip to content

Commit

Permalink
Add unique test identifier to be able to manage logs
Browse files Browse the repository at this point in the history
Signed-off-by: Katarzyna Treder <[email protected]>
  • Loading branch information
Katarzyna Treder committed Jan 7, 2025
1 parent 1934e80 commit da7e430
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/functional/test-framework
Submodule test-framework updated 1 files
+19 −2 log/logger.py
3 changes: 3 additions & 0 deletions test/functional/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"],
Expand Down

0 comments on commit da7e430

Please sign in to comment.