From bcee61edf709caffaa4b709dd2b7c887f01446c6 Mon Sep 17 00:00:00 2001 From: mesh-tools Date: Tue, 20 Oct 2026 21:19:15 +0000 Subject: [PATCH] Skip, loudly, a build module's real-toolchain test where the check's image lacks the tool; it is proven live on a build node (issues 1486, 1490) --- .../mesh-build-go/test_real_integration_test.go | 14 ++++++++++++++ .../cmd/mesh-build-node/build_integration_test.go | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/mesh-build-go/cmd/mesh-build-go/test_real_integration_test.go b/modules/mesh-build-go/cmd/mesh-build-go/test_real_integration_test.go index b847d8d4..f6bdf6a4 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/test_real_integration_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/test_real_integration_test.go @@ -24,6 +24,17 @@ func TestMain(m *testing.M) { os.Exit(m.Run()) } +// needTools skips, loudly, a test whose tools are not installed where the check runs (the mesh's Go toolchain image +// holds no postgres): the level is proven live on a build node, which has them (issue 1486). +func needTools(t *testing.T, what string, tools ...string) { + t.Helper() + for _, tool := range tools { + if _, err := exec.LookPath(tool); err != nil { + t.Skipf("NOT RUN: no %s installed where this check runs (%s); proven live on a build node", tool, what) + } + } +} + // repository copies a fixture repository into a git tree, as a fetch leaves one. func repository(t *testing.T, name string) string { t.Helper() @@ -43,6 +54,7 @@ func repository(t *testing.T, name string) string { // test_test.go read the output captured from them, and this one proves the capture is what the real go says today. It // starts go test, so it carries the tag. func TestUnitLevelRunsTheRealGoOnTheFixtureRepositories(t *testing.T) { + needTools(t, "the unit level on fixtures", "go", "git") want := map[string]struct { passed, noTests bool failed string @@ -84,6 +96,7 @@ func processesNamed(text string) []string { // integration level passes, and afterwards no postgres or bus process of the run is left and its directory is gone. // It starts postgres and a bus, so it runs in the merge check and in a try, never on the way. func TestIntegrationLevelRunsAgainstARealStoreAndBusAndLeavesNothing(t *testing.T) { + needTools(t, "the integration level", "go", "git", "initdb", "pg_ctl", "postgres") tree := repository(t, "store") // A short work directory: a unix socket's path is bounded at 108 bytes. work, err := os.MkdirTemp("/tmp", "w") @@ -121,6 +134,7 @@ func TestIntegrationLevelRunsAgainstARealStoreAndBusAndLeavesNothing(t *testing. // 1487/AC2: given a fixture Go module, when it is built twice, both digests are equal and the archive holds one // executable named as binaryName says. It runs the real go, so it carries the tag. func TestBuildTwiceGivesOneDigestAndOneExecutable(t *testing.T) { + needTools(t, "the build", "go") work := t.TempDir() tree := filepath.Join(work, "ws1", "tree") if err := os.MkdirAll(tree, 0o755); err != nil { diff --git a/modules/mesh-build-node/cmd/mesh-build-node/build_integration_test.go b/modules/mesh-build-node/cmd/mesh-build-node/build_integration_test.go index 4b93208a..a7faa3d6 100644 --- a/modules/mesh-build-node/cmd/mesh-build-node/build_integration_test.go +++ b/modules/mesh-build-node/cmd/mesh-build-node/build_integration_test.go @@ -19,7 +19,7 @@ func realMachine(t *testing.T) (*Module, string) { t.Helper() for _, p := range []string{"node", "npm"} { if _, err := exec.LookPath(p); err != nil { - t.Skipf("%s is not installed", p) + t.Skipf("NOT RUN: no %s installed where this check runs (the mesh's Go toolchain image holds none); proven live on a build node", p) } } home, cache, work := t.TempDir(), t.TempDir(), t.TempDir()