Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions __tests__/run-batched-mutation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,25 @@ describe('batched mutation runner', () => {
expect(runner.isEntrypoint(pathToFileURL(scriptPath).href, undefined)).toBe(false)
})

it('disables per-file Stryker break exits before enforcing the aggregate gate', async () => {
it('invokes Stryker per file without the unsupported --thresholds.break flag', async () => {
const result = await runFixture({ statuses: ['Killed'] })

expect(result.exitCode).toBe(0)
expect(result.command).toBe('pnpm')
expect(result.args).toEqual(runner.strykerArgs('src/example.ts'))
expect(result.args).toContain('--thresholds.break')
expect(result.args).toContain('0')
// Stryker 9.x removed dot-notation CLI options, so passing --thresholds.break
// makes every per-file run fail with "unknown option". The runner catches
// per-file break exits and gates on the aggregate instead.
Comment thread
goanpeca marked this conversation as resolved.
Outdated
expect(result.args).not.toContain('--thresholds.break')
expect(result.args).toEqual([
'exec',
'stryker',
'run',
'--mutate',
'src/example.ts',
'--reporters',
'clear-text,json',
])
})

it('fails all-error reports instead of treating an empty valid denominator as 100%', async () => {
Expand Down
16 changes: 5 additions & 11 deletions scripts/run-batched-mutation-lib.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,11 @@ export function runBatchedMutation({
}

export function strykerArgs(file) {
return [
'exec',
'stryker',
'run',
'--mutate',
file,
'--reporters',
REPORTERS,
'--thresholds.break',
'0',
]
// No `--thresholds.break` here: Stryker 9.x removed dot-notation CLI options,
// so passing it makes the per-file run fail with "unknown option". A per-file
// run dropping below the configured break threshold is expected and harmless
// (the caller catches the non-zero exit and gates on the aggregate instead).
return ['exec', 'stryker', 'run', '--mutate', file, '--reporters', REPORTERS]
Comment thread
goanpeca marked this conversation as resolved.
Outdated
}

export function defaultPnpmCommand(platform = process.platform) {
Expand Down
Loading