From 5651adb439ab50dcedfccf888f94e6422211f16e Mon Sep 17 00:00:00 2001 From: PJ Date: Mon, 17 Aug 2026 23:44:26 +0530 Subject: [PATCH] test(implementation-sweep): supply the binaries the missing-binary test does not test resolveBinaries ranges a map, so with more than one binary absent the error named whichever it reached first. The test passed locally only because bun and sanderling were on PATH; on CI it was a three-way coin flip. --- .../implementation-sweep/sweep_test.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cmd/internal-tools/implementation-sweep/sweep_test.go b/cmd/internal-tools/implementation-sweep/sweep_test.go index f0e3521..8665716 100644 --- a/cmd/internal-tools/implementation-sweep/sweep_test.go +++ b/cmd/internal-tools/implementation-sweep/sweep_test.go @@ -65,19 +65,28 @@ func TestDiscoverImplementations_EmptyDirectoryIsRefused(t *testing.T) { func TestRunSweep_StopsBeforeItInstallsAnythingWhenABinaryIsMissing( t *testing.T, ) { - implementations := t.TempDir() + root := t.TempDir() + implementations := filepath.Join(root, "implementations") if err := os.MkdirAll(filepath.Join(implementations, "impl-01"), 0o755); err != nil { t.Fatal(err) } - output := filepath.Join(t.TempDir(), "campaigns") + output := filepath.Join(root, "campaigns") configuration := config{ implementationsDirectory: implementations, outputDirectory: output, basePort: 5300, concurrency: 1, - bunPath: "bun", - campaignPath: "campaign-that-is-not-installed", - sanderlingPath: "sanderling", + bunPath: writeScript( + t, + filepath.Join(root, "stub-bun"), + "#!/bin/sh\nexit 0\n", + ), + campaignPath: "campaign-that-is-not-installed", + sanderlingPath: writeScript( + t, + filepath.Join(root, "stub-sanderling"), + "#!/bin/sh\nexit 0\n", + ), } err := runSweep(t.Context(), configuration, os.Stdout) if err == nil || !strings.Contains(err.Error(), "--campaign") {