@@ -385,17 +385,16 @@ assert_broad_tier() {
385385 rm -rf " $tmp "
386386}
387387
388- # Regression, found in independent review of this change: the broad tier used to
389- # resolve BEFORE the unresolved-suite backstop, so an unrelated go.mod bump in
390- # the same diff swallowed that per-path escalation and its stderr line. That is
391- # the merge-before-escalate shape #3330 removed from the graph walk.
388+ # A broad path must not weaken an unknown path's per-path escalation. This small
389+ # case keeps the original regression trigger visible beside the full mixed-path
390+ # matrix below.
392391@test " an unresolved suite still escalates when a broad path is in the diff" {
393392 tmp=$( mktemp -d)
394393 cp -r packages/core/platform/sources " $tmp /sources"
395394 printf ' go.mod\nhack/e2e-chainsaw/nosuch/a.yaml\n' > " $tmp /diff"
396395 output=$( hack/select-e2e.sh " $tmp /diff" " $tmp /sources" 2> " $tmp /err" )
397396 assert_full_suite " $output "
398- grep -q ' no runnable suite is named ' " $tmp /err" \
397+ grep -Fq " 'hack/e2e-chainsaw/nosuch/a.yaml' names no runnable suite ('nosuch') " " $tmp /err" \
399398 || { echo " expected the unresolved-suite reason on stderr, got: $( cat " $tmp /err" ) " >&2 ; exit 1; }
400399 rm -rf " $tmp "
401400}
@@ -1045,46 +1044,69 @@ assert_broad_tier() {
10451044 done
10461045}
10471046
1048- @test " an edit to a non-suite directory under e2e-chainsaw escalates" {
1049- # Only a switched-off suite is ignorable. Shared material next to _lib/, or
1050- # a suite nested deeper than the depth-2 scan looks, is invisible to
1051- # all_apps — selecting nothing for it would skip E2E outright, so it
1052- # escalates through the backstop instead. That backstop is the one path
1053- # still reaching the bottom of the script now that the graph decides per
1054- # path, so pin it rather than assume it stays reachable.
1047+ @test " an unknown Chainsaw suite path escalates independently of valid neighbours" {
1048+ # A deleted suite path and the old side of a suite rename both name a
1049+ # directory absent from the runnable inventory. Each must force a full run
1050+ # on its own account: merging names before checking membership lets a valid
1051+ # direct or graph-selected neighbour hide the unknown one. A broad path is
1052+ # another neighbour, and its 20-suite answer must not pre-empt the full run.
10551053 tmp=$( mktemp -d)
10561054 cp -r packages/core/platform/sources " $tmp /sources"
1057- # Premise: the directory must not exist, or all_apps would hold it and the
1058- # test would be measuring the ordinary per-suite rule.
1059- [ ! -d hack/e2e-chainsaw/_fixtures ]
1060- echo " hack/e2e-chainsaw/_fixtures/tenant.yaml" > " $tmp /diff"
1055+ [ ! -d hack/e2e-chainsaw/deleted-suite ]
1056+ [ ! -d hack/e2e-chainsaw/renamed-postgres ]
1057+
1058+ for neighbour in \
1059+ hack/e2e-chainsaw/postgres/chainsaw-test.yaml \
1060+ packages/apps/postgres/Chart.yaml; do
1061+ for broad in ' ' go.mod; do
1062+ for order in unknown-first unknown-last; do
1063+ unknown=hack/e2e-chainsaw/deleted-suite/chainsaw-test.yaml
1064+ if [ " $order " = unknown-first ]; then
1065+ printf ' %s\n' " $unknown " " $neighbour " " $broad " > " $tmp /diff"
1066+ else
1067+ printf ' %s\n' " $broad " " $neighbour " " $unknown " > " $tmp /diff"
1068+ fi
1069+ output=$( hack/select-e2e.sh " $tmp /diff" " $tmp /sources" 2> " $tmp /err" )
1070+ assert_full_suite " $output "
1071+ if ! grep -Fq " '$unknown ' names no runnable suite ('deleted-suite')" " $tmp /err" ; then
1072+ echo " unknown path must explain the full run ($neighbour , ${broad:- no broad} , $order ); stderr was:" >&2
1073+ cat " $tmp /err" >&2
1074+ exit 1
1075+ fi
1076+ done
1077+ done
1078+ done
1079+
1080+ # A rename diff contains both the old unknown directory and the new valid
1081+ # one. The old side still escalates even though the new side selects a suite.
1082+ old=hack/e2e-chainsaw/renamed-postgres/chainsaw-test.yaml
1083+ printf ' %s\n' " $old " hack/e2e-chainsaw/postgres/chainsaw-test.yaml > " $tmp /diff"
10611084 output=$( hack/select-e2e.sh " $tmp /diff" " $tmp /sources" 2> " $tmp /err" )
10621085 assert_full_suite " $output "
1063- # The backstop is the last branch that could reach the full suite without
1064- # saying so. It names the directly-selected names it could not resolve, which
1065- # for this diff is the directory the per-suite rule derived.
1066- if ! grep -q " select-e2e:.*no runnable suite is named by.*_fixtures" " $tmp /err" ; then
1067- echo " the backstop must name what it could not resolve; stderr was:" >&2
1068- cat " $tmp /err" >&2
1069- exit 1
1070- fi
1071- # Several unresolved directories, with one of them repeated: every distinct
1072- # name must appear, exactly once, in one line. The list used to be built by
1073- # `tr | sort -u | grep -v | paste`, whose exit status is paste's, so a failure
1074- # anywhere earlier in it would have gone unseen under set -e and printed a
1075- # partial name or none at all -- the same last-command blindness this script
1076- # fixes for the suite list and the yq indexes. The escalation is already
1077- # decided by then, so the only casualty is the reason line, which is exactly
1078- # what these asserts exist to defend.
1079- [ ! -d hack/e2e-chainsaw/_zz ]
1080- printf ' %s\n' hack/e2e-chainsaw/_fixtures/a.yaml \
1081- hack/e2e-chainsaw/_fixtures/b.yaml \
1082- hack/e2e-chainsaw/_zz/c.yaml > " $tmp /diff"
1086+ grep -Fq " '$old ' names no runnable suite ('renamed-postgres')" " $tmp /err"
1087+ rm -rf " $tmp "
1088+ }
1089+
1090+ @test " known and disabled Chainsaw paths keep their scoped behavior" {
1091+ tmp=$( mktemp -d)
1092+ cp -r packages/core/platform/sources " $tmp /sources"
1093+
1094+ echo hack/e2e-chainsaw/postgres/chainsaw-test.yaml > " $tmp /diff"
10831095 output=$( hack/select-e2e.sh " $tmp /diff" " $tmp /sources" 2> " $tmp /err" )
1084- assert_full_suite " $output "
1085- line=$( grep ' no runnable suite is named by' " $tmp /err" )
1086- assert_selection " the backstop must name every unresolved directory once" \
1087- " $line " " select-e2e: no runnable suite is named by '_fixtures _zz' — escalating to the full suite"
1096+ assert_selection " a known direct path must stay scoped" " $output " postgres
1097+ [ ! -s " $tmp /err" ]
1098+
1099+ # Disabled files are inert even when their directory names no runnable
1100+ # suite, alone and beside a valid direct path.
1101+ disabled=hack/e2e-chainsaw/no-such-suite/chainsaw-test.yaml.disabled
1102+ echo " $disabled " > " $tmp /diff"
1103+ output=$( hack/select-e2e.sh " $tmp /diff" " $tmp /sources" 2> " $tmp /err" )
1104+ [ -z " $output " ]
1105+ [ ! -s " $tmp /err" ]
1106+ printf ' %s\n' " $disabled " hack/e2e-chainsaw/postgres/chainsaw-test.yaml > " $tmp /diff"
1107+ output=$( hack/select-e2e.sh " $tmp /diff" " $tmp /sources" 2> " $tmp /err" )
1108+ assert_selection " a disabled neighbour must stay inert" " $output " postgres
1109+ [ ! -s " $tmp /err" ]
10881110 rm -rf " $tmp "
10891111}
10901112
0 commit comments