From fe2822d43254a0c8b5ad1e612650537878059c0a Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 6 Feb 2026 14:36:11 -0500 Subject: [PATCH] chore: Fix reporting of failures for E2E tests --- .github/workflows/main.yml | 44 ++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b887d48c4..39bfb9f99 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -266,29 +266,21 @@ jobs: message-id: e2e-test-results - name: Check test results - uses: actions/github-script@v7 - with: - script: | - const fs = require('fs'); - const path = require('path'); - - let totalFailed = 0; - - try { - const resultsDir = 'all-test-results'; - const shards = fs.readdirSync(resultsDir); - - for (const shard of shards) { - const resultsPath = path.join(resultsDir, shard, 'results.json'); - if (fs.existsSync(resultsPath)) { - const results = JSON.parse(fs.readFileSync(resultsPath, 'utf8')); - totalFailed += results.stats.unexpected || 0; - } - } - - if (totalFailed > 0) { - core.setFailed(`${totalFailed} test(s) failed`); - } - } catch (error) { - core.setFailed(`Failed to read test results: ${error.message}`); - } + id: check-results + run: | + total_failed=0 + for dir in all-test-results/*/; do + if [ -f "${dir}results.json" ]; then + unexpected=$(jq -r '.stats.unexpected // 0' "${dir}results.json") + total_failed=$((total_failed + unexpected)) + fi + done + if [ "$total_failed" -gt 0 ]; then + echo "::error::$total_failed E2E test(s) failed" + exit 1 + fi + # Fail when any shard failed even if we couldn't read failure count from artifacts + if [ "${{ needs.e2e-tests.result }}" = "failure" ]; then + echo "::error::One or more E2E test shards failed" + exit 1 + fi