Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 6 additions & 5 deletions tests/unit/tooling/strykerWorkflowPolicy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const workflow = readFileSync(workflowPath, 'utf8');
const scopeScriptPath = fileURLToPath(
new URL('../../../scripts/stryker-scope.mjs', import.meta.url),
);
// QNBS-v3: stays string concat — a template literal here is `${{ ${expr} }}`, a JS SyntaxError, not just a style nit.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
const githubExpression = (expression: string) => '$' + '{{ ' + expression + ' }}';

// QNBS-v3: Lock workflow/config invariants so mutation plumbing cannot silently drift.
Expand Down Expand Up @@ -61,17 +62,17 @@ describe('Stryker workflow policy', () => {

it('uses supported incremental plumbing and preserves shard identity', () => {
expect(workflow).toContain('--incrementalFile "$INCREMENTAL_FILE"');
expect(workflow).toContain('MATRIX_NAME: ' + githubExpression('matrix.name'));
expect(workflow).toContain('MATRIX_MUTATE: ' + githubExpression('matrix.mutate'));
expect(workflow).toContain(`MATRIX_NAME: ${githubExpression('matrix.name')}`);
expect(workflow).toContain(`MATRIX_MUTATE: ${githubExpression('matrix.mutate')}`);
expect(workflow).toContain(
'MATRIX_TEST_FILES: ' + githubExpression("join(matrix.testFiles, ',')"),
`MATRIX_TEST_FILES: ${githubExpression("join(matrix.testFiles, ',')")}`,
Comment thread
qnbs marked this conversation as resolved.
);
expect(workflow).toContain('TEST_FILE_ARGS+=(--testFiles "$TEST_FILES")');
expect(workflow).toContain('"${' + 'TEST_FILE_ARGS[@]}"');
expect(workflow).not.toContain(
'rm -f reports/stryker-incremental-' + githubExpression('matrix.name') + '.json',
`rm -f reports/stryker-incremental-${githubExpression('matrix.name')}.json`,
);
expect(workflow).not.toContain('--mutate "' + githubExpression('matrix.mutate') + '"');
expect(workflow).not.toContain(`--mutate "${githubExpression('matrix.mutate')}"`);
Comment thread
qnbs marked this conversation as resolved.
expect(workflow).not.toContain('STRYKER_INCREMENTAL_FILE=');
expect(workflow).toContain('merge-multiple: false');
expect(workflow).toContain('if-no-files-found: error');
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/tooling/workflowPolicyCheck.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import type { WorkflowPolicyFailure } from '../../../scripts/workflow-policy-check.d.mts';

const doc = (yaml: string) => parseDocument(yaml, { uniqueKeys: true });
// QNBS-v3: split like strykerWorkflowPolicy.test.ts's helper so Biome doesn't misread this as a JS template.
// QNBS-v3: stays string concat — a template literal here is `${{ ${expr} }}`, a JS SyntaxError, not just a style nit.
const githubExpression = (expression: string) => '$' + '{{ ' + expression + ' }}';

// QNBS-v3: contents:read is the only safe top-level default — every other form is a policy gap.
Expand Down
Loading