fix: test: 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.

Merge branch 'stepan/match-pytest-junit-names' into 'bind-9.20'

See merge request isc-projects/bind9!11085
This commit is contained in:
Štěpán Balážik 2025-12-10 12:43:08 +00:00
commit 2c076fff0e

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