@@ -123,8 +123,10 @@ describe("mutation testing workflow", () => {
123123 // Both jobs need actions:write - one to publish the map, one to read it and publish the reports.
124124 assert . equal ( workflow . match ( / a c t i o n s : w r i t e / g) ?. length , 2 )
125125 // A missing map artifact degrades to the event base inside the script, so the download step must
126- // not fail the job; the report upload keeps its own tolerance.
127- assert . equal ( workflow . match ( / c o n t i n u e - o n - e r r o r : t r u e / g) ?. length , 2 )
126+ // not fail the job. The upload that produces it is tolerant for the same reason: a failed upload
127+ // would otherwise fail this job and skip the gate entirely, so the fallback could never run. The
128+ // report upload keeps its own tolerance.
129+ assert . equal ( workflow . match ( / c o n t i n u e - o n - e r r o r : t r u e / g) ?. length , 3 )
128130 assert . equal ( workflow . match ( / C o u l d n o t w r i t e t h e j o b s u m m a r y / g) ?. length , 2 )
129131 const script = fs . readFileSync ( path . join ( repositoryRoot , "scripts/stryker-diff.mjs" ) , "utf8" )
130132 assert . ok ( script . includes ( "appendSummary([], manifest.advisories, manifest)" ) )
@@ -286,7 +288,7 @@ describe("stacked unit base resolution", () => {
286288 repository ,
287289 eventBaseSha ,
288290 childSha ,
289- [ { number : 1 , headSha : parentSha , baseRef : "main" } ] ,
291+ [ { number : 1 , headSha : parentSha , draft : false , baseRef : "main" } ] ,
290292 "main" ,
291293 )
292294 assert . equal ( resolved . baseSha , parentSha )
@@ -320,7 +322,7 @@ describe("stacked unit base resolution", () => {
320322 repository ,
321323 advancedBase ,
322324 childSha ,
323- [ { number : 1 , headSha : parentSha , baseRef : "main" } ] ,
325+ [ { number : 1 , headSha : parentSha , draft : false , baseRef : "main" } ] ,
324326 "main" ,
325327 )
326328 assert . equal ( resolved . baseSha , parentSha )
@@ -391,6 +393,18 @@ describe("stacked unit base resolution", () => {
391393 assert . equal ( draft . baseSha , eventBaseSha )
392394 assert . equal ( draft . stackedOn , null )
393395
396+ // An entry whose draft flag is missing proves nothing about gating, so it keeps the event
397+ // base like a known draft does.
398+ const unconfirmed = resolveStackedUnitBase (
399+ repository ,
400+ eventBaseSha ,
401+ childSha ,
402+ [ { number : 1 , headSha : parentSha , baseRef : "main" , draft : undefined } ] ,
403+ "main" ,
404+ )
405+ assert . equal ( unconfirmed . baseSha , eventBaseSha )
406+ assert . equal ( unconfirmed . stackedOn , null )
407+
394408 // The same entry, ready for review: the parent was gated, so it is the unit's base again.
395409 const ready = resolveStackedUnitBase (
396410 repository ,
@@ -425,7 +439,7 @@ describe("stacked unit base resolution", () => {
425439 repository ,
426440 eventBaseSha ,
427441 childSha ,
428- [ { number : 1 , headSha : parentSha , baseRef : "feature/other" } ] ,
442+ [ { number : 1 , headSha : parentSha , draft : false , baseRef : "feature/other" } ] ,
429443 "main" ,
430444 )
431445 assert . equal ( featureBranchParent . baseSha , eventBaseSha )
@@ -436,7 +450,7 @@ describe("stacked unit base resolution", () => {
436450 repository ,
437451 eventBaseSha ,
438452 childSha ,
439- [ { number : 1 , headSha : parentSha , baseRef : "main" } ] ,
453+ [ { number : 1 , headSha : parentSha , draft : false , baseRef : "main" } ] ,
440454 "main" ,
441455 )
442456 assert . equal ( sameBase . baseSha , parentSha )
@@ -447,15 +461,15 @@ describe("stacked unit base resolution", () => {
447461 repository ,
448462 eventBaseSha ,
449463 childSha ,
450- [ { number : 1 , headSha : parentSha , baseRef : "main" } ] ,
464+ [ { number : 1 , headSha : parentSha , draft : false , baseRef : "main" } ] ,
451465 undefined ,
452466 )
453467 assert . equal ( unknownUnitBase . stackedOn , null )
454468 const unknownParentBase = resolveStackedUnitBase (
455469 repository ,
456470 eventBaseSha ,
457471 childSha ,
458- [ { number : 1 , headSha : parentSha } ] ,
472+ [ { number : 1 , headSha : parentSha , draft : false } ] ,
459473 "main" ,
460474 )
461475 assert . equal ( unknownParentBase . stackedOn , null )
@@ -479,8 +493,8 @@ describe("stacked unit base resolution", () => {
479493
480494 try {
481495 const map = [
482- { number : 9 , headSha : parentSha , baseRef : "feature/other" } ,
483- { number : 1 , headSha : parentSha , baseRef : "main" } ,
496+ { number : 9 , headSha : parentSha , draft : false , baseRef : "feature/other" } ,
497+ { number : 1 , headSha : parentSha , draft : false , baseRef : "main" } ,
484498 ]
485499
486500 const unitOnMain = resolveStackedUnitBase ( repository , eventBaseSha , childSha , map , "main" )
@@ -621,7 +635,7 @@ describe("stacked unit base resolution", () => {
621635 advancedBase ,
622636 mergeSha ,
623637 childSha ,
624- [ { number : 1 , headSha : parentSha , baseRef : "main" } ] ,
638+ [ { number : 1 , headSha : parentSha , draft : false , baseRef : "main" } ] ,
625639 "main" ,
626640 )
627641 assert . equal ( stacked . baseSha , parentSha )
@@ -655,7 +669,7 @@ describe("stacked unit base resolution", () => {
655669 repository ,
656670 advancedBase ,
657671 multiParentHead ,
658- [ { number : 1 , headSha : parentSha , baseRef : "main" } ] ,
672+ [ { number : 1 , headSha : parentSha , draft : false , baseRef : "main" } ] ,
659673 "main" ,
660674 )
661675 assert . equal ( multi . baseSha , advancedBase )
@@ -666,7 +680,7 @@ describe("stacked unit base resolution", () => {
666680 advancedBase ,
667681 multiParentHead ,
668682 multiParentHead ,
669- [ { number : 1 , headSha : parentSha , baseRef : "main" } ] ,
683+ [ { number : 1 , headSha : parentSha , draft : false , baseRef : "main" } ] ,
670684 "main" ,
671685 ) . stackedOn ,
672686 null ,
@@ -723,7 +737,7 @@ describe("stacked unit base resolution", () => {
723737 advancedBase ,
724738 mergeSha ,
725739 childSha ,
726- [ { number : 1 , headSha : parentSha , baseRef : "main" } ] ,
740+ [ { number : 1 , headSha : parentSha , draft : false , baseRef : "main" } ] ,
727741 "main" ,
728742 )
729743 assert . equal ( invocation . diffHead , childSha )
0 commit comments