ci: add cross-platform test matrix#24
Open
don-petry wants to merge 13 commits intooneirosoft:mainfrom
Open
Conversation
Run the verify job on ubuntu-24.04, macos-latest, and windows-latest using a matrix strategy with fail-fast disabled so all platforms report results independently. Refs oneirosoft#11 (item 3) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds cross-platform coverage to the existing CI verification job by running the same Rust formatting, compilation, and test steps on Ubuntu, macOS, and Windows.
Changes:
- Convert
verifyinto a matrix job running onubuntu-24.04,macos-latest, andwindows-latest - Disable
fail-fastso failures on one OS don’t cancel the others
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9cab53f to
c5eff9b
Compare
Replace direct uses of std::os::unix::process::ExitStatusExt in test code with cfg-gated helper functions that compile on both Unix and Windows platforms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test `reports_pull_request_base_updates_before_each_retarget` failed
on Windows because it used a Unix shell script as a fake `gh` executable
which Windows cannot execute. The real `gh` CLI was found instead,
failing due to missing GH_TOKEN in CI.
Three fixes:
- Use a .cmd batch script on Windows instead of a shell script
- Use platform-appropriate PATH separator (`;` on Windows, `:` on Unix)
- Create the fake executable with .cmd extension on Windows so
Command::new("gh") can discover it
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
On Windows, Command::new("gh") only resolves gh.exe via CreateProcessW,
not gh.cmd scripts. The previous approach of prepending a fake-bin dir
to PATH with a gh.cmd wrapper was ineffective because the real gh.exe
was always found first.
Introduce a gh_program() helper that checks DAGGER_GH_BIN before
falling back to "gh". The test now sets this env var on Windows to
point directly at the .cmd wrapper, bypassing PATH resolution entirely.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The init_lineage_shows_tracked_pull_request_numbers test failed on Windows because the fake gh mock was a Unix shell script that Windows cannot execute. - Add Windows .cmd batch script variant for the fake gh in branch tests - install_fake_executable now writes .cmd files on Windows - path_with_prepend uses ; separator on Windows instead of : - git_binary_path uses where instead of which on Windows - Set DAGGER_GH_BIN env var so gh_program() finds the .cmd wrapper Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Windows .cmd equivalents for every fake gh shell script in pr.rs and pass DAGGER_GH_BIN to ensure the correct executable is resolved. This follows the same cross-platform pattern already applied to branch.rs and support/mod.rs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…for Windows Three fixes for Windows CI test failures in tests/pr.rs: 1. Add read_gh_log() helper that strips quotes and trims trailing spaces from each log line. On Windows, echo %* in .cmd scripts preserves literal quote characters and appends a trailing space. 2. Fix .cmd scripts using for /f to set CURRENT_BRANCH by enabling delayed expansion (setlocal enabledelayedexpansion) and using !CURRENT_BRANCH! instead of %CURRENT_BRANCH%. Without this, the variable is expanded at parse time (empty) rather than at execution time. 3. Add diagnostic message to pr_reports_missing_gh_cli assertion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
On Windows, a missing gh executable produces "program not found" instead of io::ErrorKind::NotFound, so normalize_gh_spawn_error doesn't convert it to the friendly message. Accept both variants in the assertion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update install_fake_gh in sync.rs to accept both Unix and Windows scripts (matching the pattern already applied in pr.rs). Add DAGGER_GH_BIN env var and read_gh_log normalization for cross-platform gh log assertions. Affected tests: - sync_repairs_closed_child_pull_request_after_remote_parent_branch_deletion - sync_repairs_multiple_child_pull_requests_with_one_temporary_parent_restore - sync_skips_pull_request_repair_for_open_merged_or_retargeted_children - sync_repairs_closed_child_pull_request_when_parent_branch_is_missing_locally - sync_removes_local_parent_branch_after_repair_when_parent_was_merged_upstream - sync_aborts_before_local_cleanup_when_pull_request_repair_fails Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…_executable On Windows, install_fake_executable appends ".cmd" to the filename, but git hooks must be named without extensions (git uses its bundled MSYS2 bash to run them). This caused the update hook to never execute, so the origin-updates.log stayed empty and count_remote_ref_updates returned 0 instead of the expected 2. Write the hook file directly with forward-slash paths (MSYS2 bash treats backslashes as escape characters) and set executable permissions on Unix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@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.
Why?
Cross-platform CI catches real portability bugs before they reach users. The Windows test failures revealed that the test suite's
ghCLI mocking strategy was Unix-only — shell scripts can't execute on Windows. This PR fixes the underlying portability gap so the full test suite passes on all three platforms.Addresses item 3 in #11.
Summary
verifyjob into a cross-platform matrix running on ubuntu-24.04, macos-latest, and windows-latest withfail-fast: falseDAGGER_GH_BINenv var override insrc/core/gh.rsso tests can point to a fakeghexecutable on Windows (whereCommand::new("gh")only resolves.exe, not.cmd).cmdbatch script equivalents for all fakeghmocks across unit tests (src/core/sync.rs), integration tests (tests/pr.rs,tests/sync.rs,tests/branch.rs);vs:), executable discovery (wherevswhich), andechoquoting behaviorread_gh_log()test helpers to normalize logged output across platforms (strip Windows-added quotes and trailing whitespace)Test plan
🤖 Generated with Claude Code