mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
test: the real waitValidate is exercised against a cancelled dispatch
Code review r2 (M1): the cancelled-run filter in merge-candidate's waitValidate had no test or mutant — every test replaced ops.waitValidate with a fake. realOps now takes an injectable `exec` (default: the same spawnSync wrapper) so the real implementation runs against scripted `gh run list` answers: a cancelled dispatch is skipped and its replacement followed; a lone cancelled run ends in `missing`, never red. Mutant: merge-trusts-cancelled-dispatch. Issue: #510 User-Visible: no
This commit is contained in:
@@ -8158,6 +8158,17 @@ const MUTANT_DEFINITIONS = [
|
||||
replace: " if (false) { // mutant: cancelled counts as red",
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'merge-trusts-cancelled-dispatch',
|
||||
guard: 'node --test test/merge-candidate.test.mjs',
|
||||
because: 'the real waitValidate must skip a dispatch cancelled by its replacement; reading it as red '
|
||||
+ 'fails the merge candidate for nothing (#510 review r2 M1, #511)',
|
||||
patches: [{
|
||||
file: 'scripts/merge-candidate.mjs',
|
||||
find: " const runs = all.filter((x) => (!event || x.event === event) && x.conclusion !== 'cancelled');",
|
||||
replace: " const runs = all.filter((x) => (!event || x.event === event)); // mutant: cancelled is red",
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'review-trusts-push-run-without-mutants',
|
||||
guard: 'node --test test/validate-gate.test.mjs',
|
||||
|
||||
Reference in New Issue
Block a user