Skip to content

Commit

Permalink
Merge branch 'latest' into net
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
  • Loading branch information
matttbe committed Aug 21, 2024
2 parents b92dd21 + 9a3968d commit ec60734
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tap2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def get_args_parser():

# Same as in NIPA
TAP_RE = re.compile(r"(not )?ok (\d+)( -)? ([^#]*[^ ])( # )?([^ ].*)?$")
TIME_RE = re.compile(r"time=([0-9.]+)ms")

def parse_tap(tap, name, only_fails):
results = {}
Expand All @@ -72,14 +73,18 @@ def parse_tap(tap, name, only_fails):
'name': r[3]
}

if r[5]:
if r[4] and r[5]:
result['comment'] = r[5]
if success:
if r[5].lower().startswith('skip'):
result['result'] = "skip"
elif r[5].lower().startswith('ignore flaky'):
result['result'] = "flaky"

t = TIME_RE.findall(r[5].lower()).groups()
if t:
result['time_ms'] = t[-1] # take the last one

if only_fails and result['result'] == "pass":
continue

Expand Down

0 comments on commit ec60734

Please sign in to comment.