From 251a57c1ab3ffb6f80eb147bd119ff5fe27e806c Mon Sep 17 00:00:00 2001 From: JackyWoo Date: Thu, 19 Sep 2024 17:15:04 +0800 Subject: [PATCH] test ci --- .github/workflows/generate_test_report.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate_test_report.py b/.github/workflows/generate_test_report.py index 11ff791d8b..7a3b3f956e 100644 --- a/.github/workflows/generate_test_report.py +++ b/.github/workflows/generate_test_report.py @@ -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', '
') 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)] = [] @@ -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 = ( "
\n"