From 9d402aa100310047d81ecea3fe28af6b663aeedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Mon, 13 Oct 2025 18:45:15 +0200 Subject: [PATCH] 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. --- bin/tests/convert-trs-to-junit.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/tests/convert-trs-to-junit.py b/bin/tests/convert-trs-to-junit.py index fdfd8cf3ce..927506a827 100755 --- a/bin/tests/convert-trs-to-junit.py +++ b/bin/tests/convert-trs-to-junit.py @@ -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