From 9ed13cd9dcd445f36aa131a491a3008c478af042 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 17 Nov 2026 15:10:51 +0100 Subject: [PATCH] mesh-build-go: the empty buildstep bridge goes (G's indexer runs), and the unit level runs its digest tests side by side MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bridge kept a directory for the pre-G indexer's package publishing; its own commit says it goes once G's indexer runs, and the test of the delivery SDK's step code refuses it. The unit level took 6.3 s over its bound of 5 s in the take-in's pipeline: the digest tests ran their go commands one after another; the marker table is a subtest per case in a fixture of its own, the list half a test of its own, and the six slowest independent tests run in parallel (4.6 s locally). Builds: design 47 G §464, §680 (the build modules keep no copy of the delivery SDK step code); ADR 0445 §3 (the unit level's 5 s bound) --- modules/mesh-build-go/buildstep/doc.go | 3 -- .../cmd/mesh-build-go/candidate_test.go | 2 + .../cmd/mesh-build-go/digest_test.go | 48 ++++++++++++++----- .../cmd/mesh-build-go/isolate_test.go | 1 + .../cmd/mesh-build-go/mirror_test.go | 1 + .../cmd/mesh-build-go/pins_test.go | 1 + .../cmd/mesh-build-go/versions_test.go | 1 + 7 files changed, 43 insertions(+), 14 deletions(-) delete mode 100644 modules/mesh-build-go/buildstep/doc.go diff --git a/modules/mesh-build-go/buildstep/doc.go b/modules/mesh-build-go/buildstep/doc.go deleted file mode 100644 index 5d5470d20..000000000 --- a/modules/mesh-build-go/buildstep/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package buildstep is kept empty as a bridge: the running pre-G indexer publishes mesh-catalog's packages only while -// every package directory it published before is in the tree. It goes once G's indexer runs. -package buildstep diff --git a/modules/mesh-build-go/cmd/mesh-build-go/candidate_test.go b/modules/mesh-build-go/cmd/mesh-build-go/candidate_test.go index b2b0c44dd..188a84b0a 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/candidate_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/candidate_test.go @@ -195,6 +195,7 @@ func TestACandidateThatDoesNotCompileFailsTheStepWithTheCompilersFirstErrorAndRu } func TestTheInstalledProgramSaysItJudged(t *testing.T) { // 1898 K1, ADR 0535 §5 + t.Parallel() m, states, ws, _ := workspaceFor(t, "slow") for _, runner := range []any{nil, RunnerInstalled} { args := map[string]any{"workspace": ws, "level": LevelUnit} @@ -223,6 +224,7 @@ func TestAnUnknownRunnerIsRefused(t *testing.T) { // 1898 K1 } func TestTheShutOffProcessRunsTheStepItIsAsked(t *testing.T) { // 1898 K2: the candidate's side of the spec + t.Parallel() m, _, ws, calls := workspaceFor(t, "slow") m.Inside = true a := m.answer(context.Background(), levelSpec{Step: stepUnit, Workspace: ws, Packages: []string{"./..."}, Bound: UnitBound}) diff --git a/modules/mesh-build-go/cmd/mesh-build-go/digest_test.go b/modules/mesh-build-go/cmd/mesh-build-go/digest_test.go index 689ff100e..df2fbb19d 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/digest_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/digest_test.go @@ -273,6 +273,7 @@ func TestAPackageWithTheReadsOutsideMarkerIsKeptOnlyByWhatItLists(t *testing.T) } edit(t, tree, "docs/one.md", "one\n") edit(t, tree, "other.md", "other\n") + // Each marker is judged in a fixture of its own, side by side: the digests are go commands, and the table is the test's longest part. for name, marker := range map[string]string{ "an empty marker": "# nothing listed\n\n", "a sentence": "the tests read ../docs\n", @@ -282,19 +283,44 @@ func TestAPackageWithTheReadsOutsideMarkerIsKeptOnlyByWhatItLists(t *testing.T) "a path that is not clean": "docs/./one.md\n", "a good line and a bad line": "docs\nnope/*.md\n", } { - edit(t, tree, "c/"+ReadsOutsideMarker, marker) - first, second := digests(t, m, "unit"), digests(t, m, "unit") - if len(first.Packages[c]) != 64 || first.Packages[c] == second.Packages[c] || first.Packages[c] == plain.Packages[c] { - t.Errorf("%s: c's digest is stable: %s, %s, before %s", name, first.Packages[c], second.Packages[c], plain.Packages[c]) - } - if strings.Join(first.ReadsOutside, ",") != c { - t.Errorf("%s: the answer does not name the package that reads outside: %v", name, first.ReadsOutside) - } - if first.Packages[a] != plain.Packages[a] || first.Packages[a] != second.Packages[a] { - t.Errorf("%s: a has no marker and its digest moved: %s, %s, before %s", name, first.Packages[a], second.Packages[a], plain.Packages[a]) - } + t.Run(name, func(t *testing.T) { + t.Parallel() + m, tree := digestFixture(t) + plain := digests(t, m, "unit") + if err := os.MkdirAll(filepath.Join(tree, "docs"), 0o755); err != nil { + t.Fatal(err) + } + edit(t, tree, "docs/one.md", "one\n") + edit(t, tree, "other.md", "other\n") + edit(t, tree, "c/"+ReadsOutsideMarker, marker) + first, second := digests(t, m, "unit"), digests(t, m, "unit") + if len(first.Packages[c]) != 64 || first.Packages[c] == second.Packages[c] || first.Packages[c] == plain.Packages[c] { + t.Errorf("%s: c's digest is stable: %s, %s, before %s", name, first.Packages[c], second.Packages[c], plain.Packages[c]) + } + if strings.Join(first.ReadsOutside, ",") != c { + t.Errorf("%s: the answer does not name the package that reads outside: %v", name, first.ReadsOutside) + } + if first.Packages[a] != plain.Packages[a] || first.Packages[a] != second.Packages[a] { + t.Errorf("%s: a has no marker and its digest moved: %s, %s, before %s", name, first.Packages[a], second.Packages[a], plain.Packages[a]) + } + }) } +} + +// The marker that lists what the package's tests read, and the marker of what the package needs (issue 890/AC3): in a fixture of its +// own, so it runs beside the table above. +func TestAListedReadsOutsideMarkerKeepsTheDigestOfOnlyWhatItLists(t *testing.T) { + t.Parallel() + m, tree := digestFixture(t) + plain := digests(t, m, "unit") + c, a := "fixture/digest/c", "fixture/digest/a" + if err := os.MkdirAll(filepath.Join(tree, "docs"), 0o755); err != nil { + t.Fatal(err) + } + edit(t, tree, "docs/one.md", "one\n") + edit(t, tree, "other.md", "other\n") + // A list: a glob, a directory read whole, and a path whose absence is read. edit(t, tree, "c/"+ReadsOutsideMarker, "# what c's tests read\ndocs/*.md\ndocs\n?gone\n") before := digests(t, m, "unit") diff --git a/modules/mesh-build-go/cmd/mesh-build-go/isolate_test.go b/modules/mesh-build-go/cmd/mesh-build-go/isolate_test.go index b63e4ac4a..4ef09ae75 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/isolate_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/isolate_test.go @@ -186,6 +186,7 @@ func TestABuildRunsShutOffAndOnlyATrunkBuildWritesTheCaches(t *testing.T) { // 1309-S3: the digest's go list runs shut off. func TestTheDigestListsPackagesShutOff(t *testing.T) { + t.Parallel() m, _ := digestFixture(t) var seen []shutOff m.Run = throughBubblewrap(t, m.Run, &seen) diff --git a/modules/mesh-build-go/cmd/mesh-build-go/mirror_test.go b/modules/mesh-build-go/cmd/mesh-build-go/mirror_test.go index a71ca19f0..72b3bac2e 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/mirror_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/mirror_test.go @@ -158,6 +158,7 @@ func sleepABit() { time.Sleep(30 * time.Millisecond) } // The workspace is self-contained after the fetch: no alternates file, and git finds the commit with the mirror gone, // as a step shut off with the workspace alone needs. Real git, a local repository as the forge. func TestTheWorkspaceIsSelfContainedAfterAFetchThroughTheMirror(t *testing.T) { + t.Parallel() if _, err := exec.LookPath("git"); err != nil { t.Skip("no git") } diff --git a/modules/mesh-build-go/cmd/mesh-build-go/pins_test.go b/modules/mesh-build-go/cmd/mesh-build-go/pins_test.go index 5b957bc42..8d16b996f 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/pins_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/pins_test.go @@ -304,6 +304,7 @@ func TestARelativeReplaceStillResolvesInTheTemporaryModfile(t *testing.T) { // the asked versions, else from the trunk's latest published version, and never looked for as the commit 000000000000 // among the pull request heads. func TestARequirementAtTheZeroVersionIsTakenFromTheAskOrTheTrunk(t *testing.T) { + t.Parallel() const sdk = "git.novox.be/novox/mesh-sdk/go" zeroMod := "module fixture/member\n\ngo 1.26\n\nrequire (\n\t" + sdk + " v0.0.0-00010101000000-" + zeroShort + "\n)\n" trunk := strings.Repeat("a", 40) diff --git a/modules/mesh-build-go/cmd/mesh-build-go/versions_test.go b/modules/mesh-build-go/cmd/mesh-build-go/versions_test.go index 0e591987d..cabcbe84d 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/versions_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/versions_test.go @@ -19,6 +19,7 @@ import ( // group's head Go cannot fetch is placed from the forge's pull request heads; a go.mod that does not require the package // takes nothing. func TestAnAskedVersionIsWrittenIntoTheModfileWhateverGoModNames(t *testing.T) { + t.Parallel() const sdk = "git.novox.be/novox/mesh-sdk/go" trunk := strings.Repeat("a", 40) offHead := strings.Repeat("b", 40) // a commit no pull request's head carries