diff --git a/internal/cmd/sling_test.go b/internal/cmd/sling_test.go index 76e0cf64..cced625c 100644 --- a/internal/cmd/sling_test.go +++ b/internal/cmd/sling_test.go @@ -328,9 +328,7 @@ exit 0 switch { case strings.Contains(args, " cook "): gotCook = true - if dir != wantDir { - t.Fatalf("bd cook ran in %q, want %q (args: %q)", dir, wantDir, args) - } + // cook doesn't need database context, runs from cwd case strings.Contains(args, " mol wisp "): gotWisp = true if dir != wantDir { diff --git a/internal/config/loader_test.go b/internal/config/loader_test.go index 345cf534..9856b658 100644 --- a/internal/config/loader_test.go +++ b/internal/config/loader_test.go @@ -2,6 +2,7 @@ package config import ( "os" + "os/exec" "path/filepath" "strings" "testing" @@ -10,6 +11,18 @@ import ( "github.com/steveyegge/gastown/internal/constants" ) +// skipIfAgentBinaryMissing skips the test if any of the specified agent binaries +// are not found in PATH. This allows tests that depend on specific agents to be +// skipped in environments where those agents aren't installed. +func skipIfAgentBinaryMissing(t *testing.T, agents ...string) { + t.Helper() + for _, agent := range agents { + if _, err := exec.LookPath(agent); err != nil { + t.Skipf("skipping test: agent binary %q not found in PATH", agent) + } + } +} + func TestTownConfigRoundTrip(t *testing.T) { t.Parallel() dir := t.TempDir() @@ -1196,6 +1209,7 @@ func TestBuildStartupCommand_UsesRigAgentWhenRigPathProvided(t *testing.T) { } func TestBuildStartupCommand_UsesRoleAgentsFromTownSettings(t *testing.T) { + skipIfAgentBinaryMissing(t, "gemini", "codex") t.Parallel() townRoot := t.TempDir() rigPath := filepath.Join(townRoot, "testrig") @@ -1247,6 +1261,7 @@ func TestBuildStartupCommand_UsesRoleAgentsFromTownSettings(t *testing.T) { } func TestBuildStartupCommand_RigRoleAgentsOverridesTownRoleAgents(t *testing.T) { + skipIfAgentBinaryMissing(t, "gemini", "codex") t.Parallel() townRoot := t.TempDir() rigPath := filepath.Join(townRoot, "testrig") @@ -1280,6 +1295,7 @@ func TestBuildStartupCommand_RigRoleAgentsOverridesTownRoleAgents(t *testing.T) } func TestBuildAgentStartupCommand_UsesRoleAgents(t *testing.T) { + skipIfAgentBinaryMissing(t, "codex") t.Parallel() townRoot := t.TempDir() rigPath := filepath.Join(townRoot, "testrig") @@ -1937,6 +1953,7 @@ func TestLookupAgentConfigWithRigSettings(t *testing.T) { } func TestResolveRoleAgentConfig(t *testing.T) { + skipIfAgentBinaryMissing(t, "gemini", "codex") t.Parallel() townRoot := t.TempDir() rigPath := filepath.Join(townRoot, "testrig") diff --git a/internal/rig/manager_test.go b/internal/rig/manager_test.go index f012bc74..be345581 100644 --- a/internal/rig/manager_test.go +++ b/internal/rig/manager_test.go @@ -460,6 +460,9 @@ fi if [[ "$1" == "--no-daemon" ]]; then shift fi +if [[ "$1" == "--allow-stale" ]]; then + shift +fi cmd="$1" shift case "$cmd" in