Skip to content

Commit

Permalink
contest: kunit: 'namify' the test names
Browse files Browse the repository at this point in the history
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) <[email protected]>
  • Loading branch information
matttbe committed Jun 11, 2024
1 parent cbfbd2b commit 40a0966
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions contest/remote/kunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import subprocess

from core import NipaLifetime
from lib import Fetcher
from lib import Fetcher, namify


"""
Expand Down Expand Up @@ -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"])
Expand Down

0 comments on commit 40a0966

Please sign in to comment.