Skip to content

ci: run test suite on Windows - #267

Open
gme-muriuki wants to merge 2 commits into
symposium-dev:mainfrom
gme-muriuki:feat/windows-ci
Open

ci: run test suite on Windows#267
gme-muriuki wants to merge 2 commits into
symposium-dev:mainfrom
gme-muriuki:feat/windows-ci

Conversation

@gme-muriuki

@gme-muriuki gme-muriuki commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Runs the full test suite on windows-latest in CI, and fixes the portability issues that surfaced.

CI

  • Adds windows-latest to the test matrix (fail-fast: false); puts git's sh on PATH; adds concurrency + cancel-in-progress, job timeouts, and shell: bash on the agent-disable step.
  • New .gitattributes: checks out text as LF on every OS (so shell scripts and shebang fixtures run on the Windows runner), marks binary assets, adds rust/toml diff hints.

Test portability

  • MSYS drive-letter rewrite for paths embedded in sh scripts (sh_path), canonicalize both sides before comparing paths, forward-slash paths in fixture TOML/JSON, and .sh fixtures referenced via script (Windows cannot spawn a shell script as executable).
  • Cross-platform mock cargo: runs the #!/bin/sh mock through sh via a .cmd shim on Windows (no production change; the shim relies on sh being on PATH).
  • normalize_paths now also matches the home-abbreviated (~/) config path, so snapshots stay stable when the temp dir lives under $HOME (always the case on Windows).

Production fixes the Windows run surfaced

  • hook.rs builds PATH with std::env::join_paths instead of a hardcoded : (wrong separator on Windows); adds a covering test.
  • predicate.rs warns when sh is missing instead of silently evaluating shell(...) predicates false.

Self-update tests

  • 6 run on Windows via the cross-platform mock. The 2 auto_update_re_execs_* tests are #[ignore]d on Windows (they overwrite the running binary and re-exec into it, which needs a Windows-native port); they still compile everywhere, so their helpers need no #[cfg].

Verified locally on Windows: suite green except an offline crates.io network test; cargo fmt clean; clippy clean bar 5 pre-existing warnings in an untouched file.

Follow-ups (not in this PR): port the 2 re_exec tests to run on Windows; investigate intermittent init_sync flakiness under heavy parallel load.

Disclosure questions

AI disclosure.

  • The AI tool authored and opened this PR autonomously

Questions for reviewers.

  • The .cmd to sh mock shim assumes sh is on PATH on Windows (a documented dev/CI requirement). Acceptable, or would you prefer a compiled mock binary?
  • Are the two #[ignore]d re_exec tests OK to leave as a follow-up?

gme-muriuki and others added 2 commits July 26, 2026 00:26
- add windows-latest to test matrix (fail-fast off); put git `sh` on
  PATH; concurrency+cancel; job timeouts; `shell: bash` on agent-disable
- .gitattributes: LF-normalize text, mark binaries, rust/toml diff hints
- portability: `sh_path` drive rewrite (predicate.rs); canonicalize both
  sides (workspace_state test); forward-slash paths in fixture TOML/JSON
  (testlib); `.sh` fixtures use `script` not `executable`
- hook.rs: build PATH via `join_paths` (was hardcoded `:`, wrong on Windows) +test
- predicate.rs: warn on missing `sh` instead of silent false
- testlib: cross-platform mock cargo via `.cmd`->`sh` shim; normalize_paths
  matches home-abbreviated (`~/`) config path so snapshots stay stable when
  temp lives under $HOME (Windows)
- un-gate 6 self-update tests; 2 re_exec tests `#[ignore]`d on Windows
  (compile everywhere, helpers need no cfg)
- docs: running-tests, common-issues windows notes

Co-authored-by: Claude <claude@anthropic.com>
Resolve conflicts from the depends-on / workspace-plugins refactor:
- predicate.rs: keep the sh_path test helper, drop ctx_with_script_entry
  (upstream removed its only callers)
- custom-predicate-witness0 fixture: accept upstream deletion (witness retired)

Co-authored-by: Claude <claude@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant