Files
OmniRoute/.github/workflows/nightly-mutation.yml
Diego Rodrigues de Sa e Souza 6ffde2a771 ci(mutation): split nightly into 3 parallel batches to fit 180min budget (#4150)
Split nightly mutation into 3 parallel batches to fit the 180min cap (QG v2 Fase 9 T0). Advisory/nightly-only. Integrado em release/v3.8.29.
2026-06-18 03:48:32 -03:00

69 lines
2.8 KiB
YAML

name: Nightly Mutation
on:
schedule:
- cron: "17 3 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
stryker:
name: Stryker mutation (batch ${{ matrix.batch.name }} — advisory)
runs-on: ubuntu-latest
# Mutation testing is expensive. History of the budget:
# - Full 8-module set TIMED OUT at the 180min cap (run 27705123780 = exactly 180min).
# The two god-files chatCore.ts/combo.ts dominate ~2/3 of the mutants and were
# removed from stryker.conf.json `mutate` (the Onda 3 split re-adds them).
# - The remaining 6 modules STILL timed out at 180min (run 27732877861 = exactly
# 180min): auth.ts and accountFallback.ts are large and the perTest dry-run over
# ~130 covering test files is itself costly.
# So the 6 modules are split into 3 PARALLEL batches of 2 (the two big modules in
# separate batches), each overriding the mutate set via `--mutate` (Stryker 9 CLI:
# `-m, --mutate <comma-list>`; the conf's `mutate[]` remains the local-run default/union).
# Each batch is ~1/3 of the mutants and fits 180min; full coverage every night, in
# parallel (≈180min wall-clock). Re-merge into fewer batches once the Onda 3 god-file
# split shrinks per-module mutant counts.
# Runs at stryker concurrency=4 with per-process DATA_DIR isolation
# (tests/_setup/isolateDataDir.ts) — see _concurrency_comment in stryker.conf.json.
strategy:
fail-fast: false
matrix:
batch:
- name: a
mutate: "src/sse/services/auth.ts,open-sse/utils/publicCreds.ts"
- name: b
mutate: "open-sse/services/accountFallback.ts,open-sse/utils/error.ts"
- name: c
mutate: "src/server/authz/routeGuard.ts,src/shared/utils/circuitBreaker.ts"
timeout-minutes: 180
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: "24"
cache: npm
- run: npm ci
- name: Restore Stryker incremental cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: reports/mutation/stryker-incremental.json
key: stryker-incremental-${{ matrix.batch.name }}-${{ github.run_id }}
restore-keys: stryker-incremental-${{ matrix.batch.name }}-
- name: Run Stryker (advisory)
id: stryker
continue-on-error: true
env:
BATCH_MUTATE: ${{ matrix.batch.mutate }}
run: npx stryker run --mutate "$BATCH_MUTATE"
- name: Upload mutation report
if: always()
uses: actions/upload-artifact@v7
with:
name: mutation-report-${{ matrix.batch.name }}
path: reports/mutation/
if-no-files-found: warn
retention-days: 14