diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index b028676aa7..61e9c6932e 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -80,9 +80,40 @@ jobs: - name: Run Tests working-directory: ./frontend + env: + PLAYWRIGHT_REPORTER: list,json + PLAYWRIGHT_JSON_OUTPUT_NAME: report.json run: | ./scripts/test-e2e + - name: Flaky summary + if: always() + working-directory: ./frontend + run: | + if [ ! -f report.json ]; then + echo "No report.json produced (the run failed early)." >> "$GITHUB_STEP_SUMMARY" + exit 0 + fi + + jq -r ' + [ .. | objects + | select(has("tests") and has("file")) + | select(any(.tests[]; .status == "flaky")) + | "- `\(.file):\(.line)` — \(.title)" + ] as $f + | "## Flaky tests: \($f | length)\n" + + (if ($f | length) == 0 then "_none_" else ($f | join("\n")) end) + ' report.json >> "$GITHUB_STEP_SUMMARY" + + - name: Upload JSON report + uses: actions/upload-artifact@v7 + if: always() + with: + name: integration-json-report + path: frontend/report.json + overwrite: true + retention-days: 30 + - name: Upload test result uses: actions/upload-artifact@v7 if: always() diff --git a/frontend/scripts/test-e2e b/frontend/scripts/test-e2e index fca7cf941e..f4511b53e7 100755 --- a/frontend/scripts/test-e2e +++ b/frontend/scripts/test-e2e @@ -1,8 +1,9 @@ #!/usr/bin/env bash SCRIPT_DIR=$(dirname $0); +REPORTER=${PLAYWRIGHT_REPORTER:-list}; set -ex $SCRIPT_DIR/setup; -pnpm run test:e2e -x --workers=1 --reporter=list "$@"; +pnpm run test:e2e -x --workers=1 --reporter="$REPORTER" "$@";