Skip to content

Commit

Permalink
ci: better handle pytest test cases names
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Rogozhkin <[email protected]>
  • Loading branch information
dvrogozh committed Jan 8, 2025
1 parent c959881 commit 69507b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/scripts/parse-junitxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ def print_md_row(row, print_header):
else:
print_md_row(rn, print_header)
print_header = False
print("")

if any([args.passed, args.failed, args.skipped]):
if args.stats and not args.json:
print("")
print_header = True
for idx, xml in enumerate(xmls):
for suite in xml:
Expand All @@ -86,7 +87,12 @@ def print_md_row(row, print_header):
if output:
rn = rn01
rn |= {
"Test name": case.name,
# pytest uses descriptions of classes and methods for
# the names of test cases. These descriptiosn might
# contain spaces and line breaks. Below strips them out
# making only line strings to sute Markdown tables.
"Class name": ' '.join(case.classname.split()),
"Test name": ' '.join(case.name.split()),
"Status": result,
"Time(s)": case.time,
"Message": message
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/_linux_accelerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ jobs:
python3 $PARSE_JUNIT reports/accelerate.xml --errors --failed
echo "### Skipped"
python3 $PARSE_JUNIT reports/accelerate.xml --skipped
echo "### Skipped"
python3 $PARSE_JUNIT reports/accelerate.xml --passed
} >> $GITHUB_STEP_SUMMARY
- name: Print environment
if: ${{ ! cancelled() }}
Expand Down

0 comments on commit 69507b1

Please sign in to comment.