Skip to content

Commit

Permalink
contest: kunit: only add the link at the run level
Browse files Browse the repository at this point in the history
We list the same link for every result, bloating the output
significantly. The UI has supported using the link from the global
level for a while now, only add it there.

Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed May 25, 2024
1 parent 583b1e3 commit b1d0623
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions contest/remote/kunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def load_expected(config):
return expected


def summary_result(expected, got, link, sub_path=""):
def summary_result(expected, got, sub_path=""):
if sub_path:
sub_path += '.'

Expand All @@ -98,11 +98,11 @@ def summary_result(expected, got, link, sub_path=""):

results.append({'test': case["name"],
'group': sub_path + sub_group["name"],
'result': code_to_str[code], 'link': link})
'result': code_to_str[code]})
if code:
bad_tests.append(f"{sub_group['name']} {case['name']} {case['status']}")
for grp in sub_group["sub_groups"]:
bt, res = summary_result(expected, grp, link, sub_path + grp["name"])
bt, res = summary_result(expected, grp, sub_path + grp["name"])
results += res
bad_tests += bt

Expand All @@ -129,6 +129,7 @@ def test(binfo, rinfo, config):
link = config.get('www', 'url') + '/' + \
config.get('local', 'results_path') + '/' + \
rinfo['run-cookie']
rinfo['link'] = link

with open(os.path.join(results_path, 'stdout'), 'w') as fp:
fp.write(stdout)
Expand All @@ -140,7 +141,7 @@ def test(binfo, rinfo, config):
if results_json is None:
raise InfraFail('no JSON')
expected = load_expected(config)
bad_tests, cases = summary_result(expected, results_json, link)
bad_tests, cases = summary_result(expected, results_json)

if bad_tests:
with open(os.path.join(results_path, 'bad_tests'), 'w') as fp:
Expand All @@ -150,7 +151,7 @@ def test(binfo, rinfo, config):
fp.write(e.args[0])
cases = [{'test': config.get('executor', 'test'),
'group': config.get('executor', 'group'),
'result': 'fail', 'link': link}]
'result': 'fail'}]

print("Done at", datetime.datetime.now())

Expand Down

0 comments on commit b1d0623

Please sign in to comment.