The Windows CI tests are failing during the pnpm test step in the GitHub Actions workflow. After applying the initial fixes (missing imports, syntax errors, etc.), Windows tests continue to fail while macOS and Ubuntu tests pass successfully.
- macOS: ✅ Passing
- Ubuntu: ✅ Passing
- Windows: ❌ Failing at
pnpm teststep
Issue: The test file uses fork from child_process but doesn't import it directly.
- Line 23:
let mockApp = fork(KIT_APP_PROMPT, { - The function is expected to be available as a global from the kit SDK
Root Cause: The globals are imported in test-sdk/config.js but may not be properly initialized on Windows before the tests run.
Windows uses different path separators and drive letters which can cause issues:
test-sdk/config.jsuses forward slashes in path constructionscripts/test-pre.jsmixes path styles- The sourcemap formatter tests were recently updated to handle Windows paths but may still have edge cases
The test setup process involves:
- Building the kit SDK to
./.kit - Setting environment variables (KIT, KENV, PATH)
- Importing globals from the built SDK
- Running tests that depend on these globals
On Windows, this chain may break due to:
- Path separator differences
- Environment variable handling
- Module resolution differences
Several tests spawn child processes (fork, exec) which behave differently on Windows:
- Process cleanup may not work correctly
- Signal handling differs
- File locks can prevent cleanup
test-sdk/main.test.js- Main test file with missing importstest-sdk/config.js- Test setup and global importsscripts/test-pre.js- Pre-test setup scripttest/ava.config.mjs- AVA test runner configuration
src/platform/win32.js- Windows-specific implementationssrc/platform/base.js- Base platform implementationssrc/core/utils.ts- Contains path handling utilities
.github/workflows/release.yml- GitHub Actions workflow
-
Add explicit imports in test-sdk/main.test.js:
import { fork } from 'node:child_process'
-
Ensure globals are properly loaded:
- Add verification that globals are available before tests run
- Consider adding a delay or retry mechanism for Windows
-
Fix path handling:
- Use
path.join()consistently instead of string concatenation - Normalize paths before comparisons
- Handle Windows drive letters properly
- Use
-
Improve test isolation:
- Each test should be self-contained
- Reduce dependency on global state
- Add proper cleanup in afterEach hooks
-
Add Windows-specific test configurations:
- Longer timeouts for process operations
- Different path expectations
- Platform-specific test skips where appropriate
-
Enhanced CI debugging:
- Add verbose logging for Windows runs
- Capture and analyze failed test output
- Add test retries for flaky tests
Recent CI runs show consistent Windows failures:
- Run #17086076650: Windows test failed (current)
- Run #17085144194: Windows CI test failures
- Run #17084465464: Windows path separator issues
- Run #17079282330: Sourcemap formatter cross-platform paths
- Run #17078618660: Child process cleanup issues
All failures occur in the Windows environment during the test phase, suggesting systematic platform-specific issues rather than random failures.
A repomix bundle has been created at windows-ci-failure-bundle.md containing:
- 13 files (31,039 tokens)
- All relevant test, configuration, and platform-specific files
- Complete context for debugging the Windows CI failures
- Apply the immediate fixes to unblock CI
- Run tests locally on a Windows machine if possible
- Add comprehensive logging to identify exact failure points
- Consider setting up a Windows development environment for testing
- Implement platform-specific test configurations
The Windows CI failures stem from a combination of missing imports, path handling differences, and global dependency issues. The fixes identified above should resolve the immediate blockers, but a more comprehensive review of Windows compatibility throughout the test suite is recommended for long-term stability.