ci: run test suite on Windows - #267
Open
gme-muriuki wants to merge 2 commits into
Open
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Runs the full test suite on
windows-latestin CI, and fixes the portability issues that surfaced.CI
windows-latestto thetestmatrix (fail-fast: false); puts git'sshon PATH; addsconcurrency+ cancel-in-progress, job timeouts, andshell: bashon the agent-disable step..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
shscripts (sh_path), canonicalize both sides before comparing paths, forward-slash paths in fixture TOML/JSON, and.shfixtures referenced viascript(Windows cannot spawn a shell script asexecutable).#!/bin/shmock throughshvia a.cmdshim on Windows (no production change; the shim relies onshbeing on PATH).normalize_pathsnow 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.rsbuildsPATHwithstd::env::join_pathsinstead of a hardcoded:(wrong separator on Windows); adds a covering test.predicate.rswarns whenshis missing instead of silently evaluatingshell(...)predicates false.Self-update tests
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 fmtclean; clippy clean bar 5 pre-existing warnings in an untouched file.Follow-ups (not in this PR): port the 2
re_exectests to run on Windows; investigate intermittentinit_syncflakiness under heavy parallel load.Disclosure questions
AI disclosure.
Questions for reviewers.
.cmdtoshmock shim assumesshis on PATH on Windows (a documented dev/CI requirement). Acceptable, or would you prefer a compiled mock binary?#[ignore]dre_exectests OK to leave as a follow-up?