Skip to content

Commit

Permalink
contest: vmksft-p: parse time from nested tests
Browse files Browse the repository at this point in the history
It is a useful info to display if it is available.

For the moment, I think only mptcp_connect.sh adds such info.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
  • Loading branch information
matttbe authored and kuba-moo committed Aug 22, 2024
1 parent 514381c commit 51ae64e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions contest/remote/vmksft-p.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def _parse_nested_tests(full_run):
nested_tests = False

result_re = re.compile(r"(not )?ok (\d+)( -)? ([^#]*[^ ])( # )?([^ ].*)?$")
time_re = re.compile(r"time=(\d+)ms")

for line in full_run.split('\n'):
# nested subtests support: we parse the comments from 'TAP version'
Expand All @@ -97,12 +98,19 @@ def _parse_nested_tests(full_run):
continue

v = result_re.match(line).groups()
name = v[3]
r = {'test': namify(v[3])}

if len(v) > 5 and v[4] and v[5]:
if v[5].lower().startswith('skip') and result == "pass":
result = "skip"

tests.append({'test': namify(name), 'result': result})
t = time_re.findall(v[5].lower())
if t:
r['time'] = round(int(t[-1]) / 1000.) # take the last one

r['result'] = result

tests.append(r)

return tests

Expand Down

0 comments on commit 51ae64e

Please sign in to comment.