n8n/packages/workflow/stryker.config.mjs
n8n-cat-bot[bot] 20d51382fc
chore: Tune Stryker config and fail the gate on partial mutation runs (#33007)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 17:35:26 +00:00

34 lines
1.5 KiB
JavaScript

/** @type {import('@stryker-mutator/api/core').PartialStrykerOptions} */
export default {
packageManager: 'pnpm',
testRunner: 'vitest',
plugins: ['@stryker-mutator/vitest-runner'],
// Use the Stryker-specific vitest config (vm-engine only) — see
// vitest.stryker.config.ts for the rationale.
vitest: {
configFile: 'vitest.stryker.config.ts',
},
// No `progress` reporter: these runs are non-interactive, nobody watches the stream.
reporters: ['clear-text', 'json'],
coverageAnalysis: 'perTest',
// Cache mutant results so the property-testing edit/re-run loop only re-tests
// mutants whose covering tests changed. Keep the cache under the gitignored reports/mutation/.
incremental: true,
incrementalFile: 'reports/mutation/stryker-incremental.json',
// Skip module-level (static) mutants — each forces a full re-instrument.
ignoreStatic: true,
// Default empty — the `mutate` npm script always passes --mutate <file>.
// Direct invocation with no --mutate will fail fast (allowEmpty: false).
mutate: [],
jsonReporter: { fileName: 'reports/mutation/raw.json' },
// Cap low: a string/utils mutant running 15s+ is a spinning loop-condition mutant; fail it fast.
timeoutMS: 15_000,
// Each Stryker worker spawns vitest with one project (vm-engine, via
// vitest.stryker.config.ts). Default 4 is fine on CI runners; lower
// locally if you hit OOM during the initial dry run via
// `STRYKER_CONCURRENCY=1`.
concurrency: Number(process.env.STRYKER_CONCURRENCY ?? 4),
tempDirName: '.stryker-tmp',
cleanTempDir: true,
};