fix(ci): address Windows test failures and timeout
- Extract inode function to platform-specific files (inode_unix.go, inode_windows.go) to fix syscall.Stat_t compile error on Windows - Add skipOnWindows helper and skip Unix permission/symlink tests on Windows where chmod semantics differ - Increase Windows test timeout from 10m to 20m since full test suite runs slower without race detector Fixes Windows CI failures introduced when PR #904 expanded Windows testing from smoke tests to full test suite. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
ffe0dca2a3
commit
2fb6fd074a
@@ -3,9 +3,18 @@ package fix
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// skipOnWindows skips tests that rely on Unix file permissions or symlinks.
|
||||
func skipOnWindows(t *testing.T) {
|
||||
t.Helper()
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("skipping Unix permission/symlink test on Windows")
|
||||
}
|
||||
}
|
||||
|
||||
// TestPermissions_SkipsSymlinkedBeadsDir verifies that permission fixes are skipped
|
||||
// when .beads directory is a symlink (common on NixOS with home-manager).
|
||||
//
|
||||
@@ -13,6 +22,7 @@ import (
|
||||
// - When .beads is a symlink, Permissions() should return nil without changing anything
|
||||
// - This prevents attempts to chmod symlink targets (which may be read-only like /nix/store)
|
||||
func TestPermissions_SkipsSymlinkedBeadsDir(t *testing.T) {
|
||||
skipOnWindows(t)
|
||||
tmpDir := t.TempDir()
|
||||
|
||||
// Create target .beads directory with wrong permissions
|
||||
@@ -62,6 +72,7 @@ func TestPermissions_SkipsSymlinkedBeadsDir(t *testing.T) {
|
||||
// TestPermissions_SkipsSymlinkedDatabase verifies that chmod is skipped for
|
||||
// symlinked database files, but .beads directory permissions are still fixed.
|
||||
func TestPermissions_SkipsSymlinkedDatabase(t *testing.T) {
|
||||
skipOnWindows(t)
|
||||
tmpDir := t.TempDir()
|
||||
|
||||
// Create real .beads directory with wrong permissions
|
||||
@@ -125,6 +136,7 @@ func TestPermissions_SkipsSymlinkedDatabase(t *testing.T) {
|
||||
// TestPermissions_FixesRegularFiles verifies that permissions ARE fixed for
|
||||
// regular (non-symlinked) files.
|
||||
func TestPermissions_FixesRegularFiles(t *testing.T) {
|
||||
skipOnWindows(t)
|
||||
tmpDir := t.TempDir()
|
||||
|
||||
// Create .beads directory with wrong permissions
|
||||
|
||||
Reference in New Issue
Block a user