From bc4662d656efc631b8446e89711e2e76a7732a5a Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 11 Oct 2026 21:06:44 +0200 Subject: [PATCH] End the line a walk's ask leaves open as each ADR 0299 store test ends, so its pass is read (issue 459) A walk's ask prints " tier N: " and the build ask the rest; the tests' fake ask prints nothing, so go test -v put three tests' --- PASS after it and the store-tests step read them as not run. --- cmd/mesh-controller/issue459_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd/mesh-controller/issue459_test.go b/cmd/mesh-controller/issue459_test.go index 0aa17fbc..37f1782e 100644 --- a/cmd/mesh-controller/issue459_test.go +++ b/cmd/mesh-controller/issue459_test.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "errors" + "fmt" "reflect" "slices" "strings" @@ -17,6 +18,14 @@ import ( // to leave out: the walk is ended, and every other merge it answered is walked again in a fresh batch without them // — the stopped merge, and each later merge of its repository's branch, which contains it and ends with it. +// endsItsLine ends, as the test ends, a line the controller's output left open (a walk's ask prints " tier N: " and +// the asked build the rest, which the tests' fake ask never prints): `go test -v` would put the test's "--- PASS" +// after it, and the store-tests step of merge-check.sh, which reads that marker at a line's start, would say the +// test never ran. +func endsItsLine(t *testing.T) { + t.Cleanup(func() { fmt.Println() }) +} + // leaved is a kept merge of a repository, made at a moment. func leaved(repository, commit string, made time.Time) inventory.BatchedMerge { return inventory.BatchedMerge{Repository: repository, Branch: "main", Commit: commit, Merged: made, Heard: made} @@ -114,6 +123,7 @@ func TestDeliveryStopTakesTheMergesToLeaveOut(t *testing.T) { // that builds the other repository's module alone. func TestAStopWithoutAMergeWalksTheOthersAgain(t *testing.T) { open := windowed(t) + endsItsLine(t) asksRecorded(t) ctx := t.Context() cat := catalogueMerge("cat1aaaaaaaa", "app", t0) @@ -171,6 +181,7 @@ func TestAStopWithoutAMergeWalksTheOthersAgain(t *testing.T) { // ended. A merge the walk does not answer is refused, and nothing ends. func TestAStopWithoutAMergeEndsTheMergesThatContainIt(t *testing.T) { open := windowed(t) + endsItsLine(t) asksRecorded(t) ctx := t.Context() first := catalogueMerge("cat1aaaaaaaa", "app", t0) @@ -227,6 +238,7 @@ func TestAStopWithoutAMergeEndsTheMergesThatContainIt(t *testing.T) { // (review of #232): its window closes, and its walk is at the newer commit, answering both. func TestAStopWalksTheOthersAgainInTheOpenBatch(t *testing.T) { open := windowed(t) + endsItsLine(t) asksRecorded(t) ctx := t.Context() cat := catalogueMerge("cat1aaaaaaaa", "app", t0) @@ -278,6 +290,7 @@ func TestAStopWalksTheOthersAgainInTheOpenBatch(t *testing.T) { // that walked its merges again is refused a retry, saying why. func TestAStopNamesWhatStaysOnTheMachinesAndWhatStillCarriesIt(t *testing.T) { open := windowed(t) + endsItsLine(t) asksRecorded(t) ctx := t.Context() cat := catalogueMerge("cat1aaaaaaaa", "app", t0) @@ -322,6 +335,7 @@ func TestAStopNamesWhatStaysOnTheMachinesAndWhatStillCarriesIt(t *testing.T) { // with the others and withholds the stopped merge's modules; with every merge left out, the batch is stopped. func TestAStopWithoutAMergeLeavesItOutOfABatch(t *testing.T) { open := windowed(t) + endsItsLine(t) asksRecorded(t) ctx := t.Context() cat := catalogueMerge("cat1aaaaaaaa", "app", t0) @@ -368,6 +382,7 @@ func TestAStopWithoutAMergeLeavesItOutOfABatch(t *testing.T) { // else since it was read refuses all of it, and no merge moves, no plan is written. func TestSavingPlansAndMovingMergesIsOneAct(t *testing.T) { open := windowed(t) + endsItsLine(t) ctx := t.Context() hear(t, open, catalogueMerge("cat1aaaaaaaa", "app", t0), t0.Add(time.Second)) _, bs := walks(t, open)