@@ -105,20 +105,27 @@ jobs:
105105 print(f"Warning: failed to parse {xml_file}: {e}")
106106
107107 passed = totals["tests"] - totals["failures"] - totals["errors"] - totals["skipped"]
108+ failed_count = totals["failures"] + totals["errors"]
108109
109110 # Write failed tests to a file for the comment step
110111 with open("failed-tests-shard-${{ matrix.shard }}.json", "w") as f:
111112 json.dump(failed_tests, f)
112113
113- print(f"Tests: {totals['tests']}, Passed: {passed}, "
114- f"Failed: {totals['failures'] + totals['errors']}, Skipped: {totals['skipped']}")
114+ # Write summary for comment (passed / failed counts)
115+ summary = {"tests": totals["tests"], "passed": passed, "failed": failed_count, "skipped": totals["skipped"]}
116+ with open("summary-shard-${{ matrix.shard }}.json", "w") as f:
117+ json.dump(summary, f)
118+
119+ print(f"Tests: {totals['tests']}, Passed: {passed}, Failed: {failed_count}, Skipped: {totals['skipped']}")
115120 PYEOF
116121 - name : Upload test results
117122 if : always() && steps.git-diff.outputs.diff
118123 uses : actions/upload-artifact@v4
119124 with :
120125 name : v2-test-results-shard-${{ matrix.shard }}
121- path : failed-tests-shard-${{ matrix.shard }}.json
126+ path : |
127+ failed-tests-shard-${{ matrix.shard }}.json
128+ summary-shard-${{ matrix.shard }}.json
122129
123130 comment :
124131 name : " V2 Connector: Post Results"
@@ -140,14 +147,29 @@ jobs:
140147 with open(f) as fh:
141148 all_failed.extend(json.load(fh))
142149
143- total_failed = len(all_failed)
150+ total_tests = total_passed = total_failed = total_skipped = 0
151+ for f in sorted(glob.glob("summary-shard-*.json")):
152+ with open(f) as fh:
153+ s = json.load(fh)
154+ total_tests += s.get("tests", 0)
155+ total_passed += s.get("passed", 0)
156+ total_failed += s.get("failed", 0)
157+ total_skipped += s.get("skipped", 0)
158+
159+ total_failed_count = len(all_failed) # from failed list (in case summary missing)
160+ if total_tests == 0 and total_failed_count > 0:
161+ total_failed = total_failed_count
162+ total_passed = 0
163+
144164 icon = "✅" if total_failed == 0 else "⚠️"
145165
146166 lines = []
147167 lines.append(f"## {icon} Delta Spark V2 Connector Test Results")
148168 lines.append("")
149169 lines.append(f"**Mode:** `DELTA_V2_ENABLE_MODE=STRICT`")
150170 lines.append("")
171+ lines.append(f"**{total_passed} passed**, {total_failed} failed, {total_skipped} skipped")
172+ lines.append("")
151173 if total_failed == 0:
152174 lines.append("All tests passed! 🎉")
153175 else:
0 commit comments