mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
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.
This commit is contained in:
1 parent
071f9c7f52
commit
5651adb439
1 file changed
+14
-5
@@ -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") {
|
||||
|
||||
Reference in new issue
Block a user