Skip to content

Commit deff69e

Browse files
committed
ci(cypress): Surface tests that needed retries in the job summary
Cypress saves a screenshot for every failed attempt, also when a retry passed afterwards. Listing them in the job summary keeps flaky tests visible even when the run ends green, instead of retries silently masking them. Assisted-by: ClaudeCode:claude-fable-5 Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
1 parent 47ad531 commit deff69e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/cypress.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,24 @@ jobs:
195195
SPLIT_RANDOM_SEED: ${{ github.run_id }}
196196
SETUP_TESTING: ${{ matrix.containers == 'setup' && 'true' || '' }}
197197

198+
- name: Report tests with failed attempts
199+
# Local addition (not in the org template): cypress saves a screenshot
200+
# for every failed attempt, also when a retry passed afterwards - list
201+
# them, so flaky tests stay visible even when the run is green.
202+
if: always() && matrix.containers != 'component'
203+
env:
204+
RUNNER_ID: ${{ matrix.containers }}
205+
run: |
206+
flaky=$(find cypress/snapshots -name '*(failed)*.png' 2>/dev/null | sed -e 's|^cypress/snapshots/actual/||' -e 's|\.png$||' | sort)
207+
if [ -n "$flaky" ]; then
208+
{
209+
echo "### ⚠️ Tests with failed attempts (runner $RUNNER_ID)"
210+
echo '```'
211+
echo "$flaky"
212+
echo '```'
213+
} >> "$GITHUB_STEP_SUMMARY"
214+
fi
215+
198216
- name: Upload snapshots and videos
199217
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
200218
if: always()

0 commit comments

Comments
 (0)