Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyWoo committed Sep 19, 2024
1 parent bdca28a commit 251a57c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/generate_test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ def generate_report(report_dir, report_title):

for testsuite in root.findall('testsuite'):
for testcase in testsuite.findall('testcase'):
# integration test classname is like test_auto.test, we only need the first part
classname = testcase.get('classname').split('.')[0]
name = testcase.get('name')
failure = testcase.find('failure')
status = '❌' if failure is not None else '✅'
error_message = failure.get('message').replace('\n', '<br>') if failure is not None else ''

print(f"test case: {classname} {name} {failure} {error_message} {status}")
if (classname, name) not in test_cases:
test_cases[(classname, name)] = []

Expand All @@ -37,13 +39,14 @@ def generate_report(report_dir, report_title):
for (classname, name), results in test_cases.items():
for sanitize_type, status, error_message in results:
row = f"| {classname} | {name} | {sanitize_type} | {status} | {error_message} |"
if status == '❌':
print("row:", row)
if error_message == '':
failed_tests.append(row)
else:
successful_tests.append(row)

failed_table = header + "\n".join(failed_tests) if failed_tests else "All test cases passed!"
successful_table = header + "\n".join(successful_tests) if successful_tests else ""
failed_table = header + "\n".join(failed_tests) if failed_tests else "### All test cases passed!"

collapsible_successful_table = (
"<details>\n"
Expand Down

0 comments on commit 251a57c

Please sign in to comment.