From c19b24fdd5f7204ac3dcfe66825db38ffb661b22 Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Tue, 11 Jun 2024 23:20:47 +0200 Subject: [PATCH] contest: kunit: 'namify' the test names The new subtests have spaces in their name, e.g. example.example_params_test.example value 0 It sounds better to avoid these spaces and other unwanted chars, as the test name is used to identify the test. This will break the tracking of failed tests, but it has just been broken a few days ago, probably the good time to do that again. Signed-off-by: Matthieu Baerts (NGI0) --- contest/remote/kunit.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contest/remote/kunit.py b/contest/remote/kunit.py index feb2216..fe93070 100755 --- a/contest/remote/kunit.py +++ b/contest/remote/kunit.py @@ -8,7 +8,7 @@ import subprocess from core import NipaLifetime -from lib import Fetcher +from lib import Fetcher, namify """ @@ -94,16 +94,17 @@ def summary_flat(expected, got, sub_path=""): bad_tests = [] for case in got["test_cases"]: code = str_to_code[case["status"]] + name = namify(case["name"]) - exp = expected.get(got["name"], {}).get(case["name"]) + exp = expected.get(got["name"], {}).get(name) if exp and exp == code: continue overall_code = max(code, overall_code) - results.append({'test': sub_path + case["name"], + results.append({'test': sub_path + name, 'result': code_to_str[code]}) if code: - bad_tests.append(f"{got['name']} {case['name']} {case['status']}") + bad_tests.append(f"{got['name']} {name} {case['status']}") for sub_group in got["sub_groups"]: ov, bt, res = summary_flat(expected, sub_group, sub_path + sub_group["name"])