mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 07:12:12 +03:00
Integrated into release/v3.8.29 (round 7). CI-only: stryker mutate += quotaScoring/quotaStrategies (batch f) + 6 covered chatCore leaves (batch g); nightly matrix 5->7 batches. Follow-up to #4205/#4204.
83 lines
4.3 KiB
YAML
83 lines
4.3 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 dominated ~2/3 of the mutants and were
|
|
# removed from stryker.conf.json `mutate`.
|
|
# - The remaining 6 modules in 3 batches: auth.ts and accountFallback.ts are large; the
|
|
# a (auth+publicCreds) and b (accountFallback+error) batches still ran near the 180min
|
|
# cap (the perTest dry-run over ~130 covering test files is itself costly), so the two
|
|
# big modules are now ISOLATED into their own batches (a=auth, b=accountFallback).
|
|
# - Onda 3 / Fase 9 T5 re-add: combo.ts was split into 11 leaves; the 8 well-covered
|
|
# combo/* leaves are back in `mutate` (covered by the 24 combo-*.test.ts), grouped into
|
|
# 2 batches (d=heavy, e=light). After #4204 (D7b) merged, the reset-aware quota pair
|
|
# quotaScoring/quotaStrategies was added as batch f. A covering-test audit then added the
|
|
# 6 chatCore/* leaves with direct unit coverage as batch g; the other 9 chatCore leaves
|
|
# remain a follow-up — see _mutate_godfiles_excluded_comment in stryker.conf.json.
|
|
# 7 PARALLEL 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 targets <180min; full coverage every night in parallel (~180min wall-clock).
|
|
# The `incremental` cache (per-batch key) makes runs after the first cold one much cheaper,
|
|
# so the isolated big-module batches recover even if a first cold run nears the cap.
|
|
# 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"
|
|
- name: b
|
|
mutate: "open-sse/services/accountFallback.ts"
|
|
- name: c
|
|
mutate: "src/server/authz/routeGuard.ts,src/shared/utils/circuitBreaker.ts,open-sse/utils/error.ts,open-sse/utils/publicCreds.ts"
|
|
- name: d
|
|
mutate: "open-sse/services/combo/comboStructure.ts,open-sse/services/combo/autoStrategy.ts,open-sse/services/combo/validateQuality.ts"
|
|
- name: e
|
|
mutate: "open-sse/services/combo/shadowRouting.ts,open-sse/services/combo/targetSorters.ts,open-sse/services/combo/comboPredicates.ts,open-sse/services/combo/rrState.ts,open-sse/services/combo/comboData.ts"
|
|
- name: f
|
|
mutate: "open-sse/services/combo/quotaScoring.ts,open-sse/services/combo/quotaStrategies.ts"
|
|
- name: g
|
|
mutate: "open-sse/handlers/chatCore/comboContextCache.ts,open-sse/handlers/chatCore/idempotency.ts,open-sse/handlers/chatCore/passthroughHelpers.ts,open-sse/handlers/chatCore/responseHeaders.ts,open-sse/handlers/chatCore/sanitization.ts,open-sse/handlers/chatCore/upstreamTimeouts.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
|