Skip to content

Commit 2d6a7ec

Browse files
test(ci): pin the unclassified-path reason line
The header claims "a test asserts each line" about the reason-line contract. It was false for one branch: deleting the `unclassified path` echo at the fall-through left `hack/cozytest.sh hack/select-e2e_test.bats` exiting 0. That is the worst one to leave unpinned. It is #3392's own guard, its cause is the one a reader cannot infer from the selection ("a path nobody has classified" is not expressible as a suite list), and the only action it asks for is to classify the path it names. The word "unclassified" appears in seven comments in the test file while pinning it zero times, so the branch read as covered. Verified by mutation both ways: with the assertion added, deleting the echo turns the file red, and a sweep that mutes each of the eleven `select-e2e:` messages in turn now reddens the file for every one of them, so the header's claim holds for the whole set rather than for most of it. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent b270262 commit 2d6a7ec

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎hack/select-e2e_test.bats‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,20 @@ assert_full_suite() {
302302
tmp=$(mktemp -d)
303303
cp -r packages/core/platform/sources "$tmp/sources"
304304
echo "brand-new-top-level/thing.conf" > "$tmp/diff"
305-
output=$(hack/select-e2e.sh "$tmp/diff" "$tmp/sources" 2>/dev/null)
305+
output=$(hack/select-e2e.sh "$tmp/diff" "$tmp/sources" 2>"$tmp/err")
306306
assert_full_suite "$output"
307+
# The reason line is asserted as well as the selection, and this branch is
308+
# the one that most needs it: it is #3392's own guard, the escalation whose
309+
# cause is hardest to work out from the outside (the answer is "a path nobody
310+
# has classified", which the selection cannot express), and the only action it
311+
# asks for is to go and classify the path it names. Deleting this echo used to
312+
# leave the whole file green while the word "unclassified" appeared in seven
313+
# comments here, so the branch read as covered without being pinned.
314+
if ! grep -q "select-e2e:.*unclassified path.*thing\.conf" "$tmp/err"; then
315+
echo "an unclassified path must be named on stderr; stderr was:" >&2
316+
cat "$tmp/err" >&2
317+
exit 1
318+
fi
307319
rm -rf "$tmp"
308320
}
309321

0 commit comments

Comments
 (0)