Commit a2eb462

Eric Bower  ·  2026-08-11 11:39:25 -0400 EDT
parent fc37682
fix: tests
2 files changed,  +16, -2
+1, -0
......@@ -1,3 +1,4 @@
11 pici
22 .env
33 .envrc
4+testrepo/
+15, -2
......@@ -980,6 +980,10 @@ func TestWorkspaceRsync_ExcludesGitAndJJ(t *testing.T) {
980980 }
981981
982982 func TestRunnerDoesNotCreatePublishedSentinel(t *testing.T) {
983+ if _, err := exec.LookPath("zmx"); err != nil {
984+ t.Skip("zmx not found, skipping test")
985+ }
986+
983987 tmpDir := t.TempDir()
984988 artifactDir := filepath.Join(tmpDir, "artifacts")
985989 wkDir := filepath.Join(tmpDir, "workspace")
......@@ -999,7 +1003,7 @@ zmx wait "*"
9991003
10001004 jobID := "j-no-published-test"
10011005 event := Event{
1002- Type: "git.push",
1006+ Type: "local",
10031007 Name: "no-published-repo",
10041008 JobID: jobID,
10051009 Workspace: wkDir,
......@@ -1010,7 +1014,7 @@ zmx wait "*"
10101014 Logger: slog.New(slog.NewTextHandler(io.Discard, nil)),
10111015 ArtifactDir: artifactDir,
10121016 EventSource: io.NopCloser(bytes.NewReader(append(eventJSON, '\n'))),
1013- NewWorkspace: defaultWorkspaceFactory,
1017+ NewWorkspace: func(cfg *Cfg, logger *slog.Logger, source string) Workspace { return &mockLocalWorkspace{dir: source} },
10141018 SessionPrefix: "test.",
10151019 }
10161020
......@@ -1023,3 +1027,12 @@ zmx wait "*"
10231027 t.Errorf("expected published.json NOT to exist after RunRunner, but it exists at %s", sentinel)
10241028 }
10251029 }
1030+
1031+type mockLocalWorkspace struct {
1032+ dir string
1033+}
1034+
1035+func (w *mockLocalWorkspace) Setup() error { return nil }
1036+func (w *mockLocalWorkspace) Cleanup() error { return nil }
1037+func (w *mockLocalWorkspace) GetDir() string { return w.dir }
1038+func (w *mockLocalWorkspace) Checksum() string { return "" }