ci(coverage): harden coverage guard step
Some checks failed
CI / Unit & Component Tests (push) Failing after 2m47s
CI / OCR Service Tests (push) Successful in 15s
CI / Backend Unit Tests (push) Successful in 4m4s
CI / fail2ban Regex (push) Successful in 38s
CI / Compose Bucket Idempotency (push) Successful in 55s
CI / Unit & Component Tests (pull_request) Failing after 2m49s
CI / OCR Service Tests (pull_request) Successful in 16s
CI / Backend Unit Tests (pull_request) Successful in 4m9s
CI / fail2ban Regex (pull_request) Successful in 39s
CI / Compose Bucket Idempotency (pull_request) Successful in 56s

- Add explicit set -eo pipefail so npm test:coverage exit code
  propagates through the pipe (not just tee's always-0 exit)
- Scope log file to github.run_id to prevent stale-log false positives
  on retried steps sharing the same runner /tmp
- Tighten grep pattern to \[birpc\] rpc is closed to avoid matching
  unrelated log lines that happen to contain "rpc is closed"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-11 23:18:22 +02:00
parent d8496498ea
commit e418e884b5

View File

@@ -44,7 +44,9 @@ jobs:
- name: Run coverage (server + client)
shell: bash
run: npm run test:coverage 2>&1 | tee /tmp/coverage-test.log
run: |
set -eo pipefail
npm run test:coverage 2>&1 | tee /tmp/coverage-test-${{ github.run_id }}.log
working-directory: frontend
env:
TZ: Europe/Berlin
@@ -53,9 +55,9 @@ jobs:
shell: bash
if: always()
run: |
if grep -q "rpc is closed" /tmp/coverage-test.log 2>/dev/null; then
if grep -q "\[birpc\] rpc is closed" /tmp/coverage-test-${{ github.run_id }}.log 2>/dev/null; then
echo "FAIL: [birpc] rpc is closed teardown race detected in coverage run"
grep "rpc is closed" /tmp/coverage-test.log
grep "\[birpc\] rpc is closed" /tmp/coverage-test-${{ github.run_id }}.log
exit 1
fi