Match JUnit test names of system tests in the legacy test runner

Pytest sets the test names as `test_foo` and the old test runner spits
out `bin/tests/system/foo`.

Normalize this to match the new test runner.
This commit is contained in:
Štěpán Balážik 2025-10-13 18:45:15 +02:00
parent e192a81c3d
commit 9d402aa100

View file

@ -65,7 +65,13 @@ def walk_trss(source_dir):
full_trs_path = os.path.join(cur_dir, filename)
full_log_path = os.path.join(cur_dir, log_name)
sub_dir = os.path.relpath(cur_dir, source_dir)
test_name = os.path.join(sub_dir, filename_prefix)
test_dir_path = os.path.join(sub_dir, filename_prefix)
if sub_dir.startswith("bin/tests/system"):
# Match the `pytest` style test names for system tests
test_name = f"test_{filename_prefix}"
else:
test_name = test_dir_path
t = {
"name": test_name,
@ -76,7 +82,7 @@ def walk_trss(source_dir):
# try to find dir/file path for a clickable link
try:
t["rel_file_path"] = find_test_relative_path(source_dir, test_name)
t["rel_file_path"] = find_test_relative_path(source_dir, test_dir_path)
except KeyError:
pass # no existing path found