Fixing unit tests on windows (#813)
* Add Windows stub for orphan cleanup * Fix account switch tests on Windows * Make query session events test portable * Disable beads daemon in query session events test * Add Windows bd stubs for sling tests * Make expandOutputPath test OS-agnostic * Make role_agents test Windows-friendly * Make config path tests OS-agnostic * Make HealthCheckStateFile test OS-agnostic * Skip orphan process check on Windows * Normalize sparse checkout detail paths * Make dog path tests OS-agnostic * Fix bare repo refspec config on Windows * Add Windows process detection for locks * Add Windows CI workflow * Make mail path tests OS-agnostic * Skip plugin file mode test on Windows * Skip tmux-dependent polecat tests on Windows * Normalize polecat paths and AGENTS.md content * Make beads init failure test Windows-friendly * Skip rig agent bead init test on Windows * Make XDG path tests OS-agnostic * Make exec tests portable on Windows * Adjust atomic write tests for Windows * Make wisp tests Windows-friendly * Make workspace find tests OS-agnostic * Fix Windows rig add integration test * Make sling var logging Windows-friendly * Fix sling attached molecule update ordering --------- Co-authored-by: Johann Dirry <johann.dirry@microsea.at>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -43,6 +44,10 @@ func TestNewOrphanProcessCheck(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestOrphanProcessCheck_Run(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("orphan process detection is not supported on Windows")
|
||||
}
|
||||
|
||||
// This test verifies the check runs without error.
|
||||
// Results depend on whether Claude processes exist in the test environment.
|
||||
check := NewOrphanProcessCheck()
|
||||
|
||||
@@ -120,7 +120,7 @@ func TestSparseCheckoutCheck_MayorRigMissingSparseCheckout(t *testing.T) {
|
||||
if !strings.Contains(result.Message, "1 repo(s) missing") {
|
||||
t.Errorf("expected message about missing config, got %q", result.Message)
|
||||
}
|
||||
if len(result.Details) != 1 || !strings.Contains(result.Details[0], "mayor/rig") {
|
||||
if len(result.Details) != 1 || !strings.Contains(filepath.ToSlash(result.Details[0]), "mayor/rig") {
|
||||
t.Errorf("expected details to contain mayor/rig, got %v", result.Details)
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ func TestSparseCheckoutCheck_CrewMissingSparseCheckout(t *testing.T) {
|
||||
if result.Status != StatusError {
|
||||
t.Errorf("expected StatusError for missing sparse checkout, got %v", result.Status)
|
||||
}
|
||||
if len(result.Details) != 1 || !strings.Contains(result.Details[0], "crew/agent1") {
|
||||
if len(result.Details) != 1 || !strings.Contains(filepath.ToSlash(result.Details[0]), "crew/agent1") {
|
||||
t.Errorf("expected details to contain crew/agent1, got %v", result.Details)
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,7 @@ func TestSparseCheckoutCheck_PolecatMissingSparseCheckout(t *testing.T) {
|
||||
if result.Status != StatusError {
|
||||
t.Errorf("expected StatusError for missing sparse checkout, got %v", result.Status)
|
||||
}
|
||||
if len(result.Details) != 1 || !strings.Contains(result.Details[0], "polecats/pc1") {
|
||||
if len(result.Details) != 1 || !strings.Contains(filepath.ToSlash(result.Details[0]), "polecats/pc1") {
|
||||
t.Errorf("expected details to contain polecats/pc1, got %v", result.Details)
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ func TestSparseCheckoutCheck_MixedConfigured(t *testing.T) {
|
||||
if !strings.Contains(result.Message, "1 repo(s) missing") {
|
||||
t.Errorf("expected message about 1 missing repo, got %q", result.Message)
|
||||
}
|
||||
if len(result.Details) != 1 || !strings.Contains(result.Details[0], "crew/agent1") {
|
||||
if len(result.Details) != 1 || !strings.Contains(filepath.ToSlash(result.Details[0]), "crew/agent1") {
|
||||
t.Errorf("expected details to contain only crew/agent1, got %v", result.Details)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user