fix(test): gate scriptable transform-hook tests behind cfg(unix) to unbreak Windows CI#6306
Merged
Merged
Conversation
…nbreak Windows CI The #6291 transform_tool_result hook tests execute a real #!/bin/sh script through the native script runtime. Windows has no /bin/sh, so the spawn fails and the metrics assertions don't hold, failing both Windows test shards and turning main red (#6304) — every open PR then inherits the failure on its next run. Gate the four shell-script tests and their make_transform_script / make_transform_engine helpers (plus the now-test-only MemorySubstrate / ToolExecutionStatus imports) behind #[cfg(unix)]. The transform-hook feature is unchanged and still covered on Linux and macOS.
houko
enabled auto-merge (squash)
June 24, 2026 04:24
houko
added a commit
that referenced
this pull request
Jun 24, 2026
…indows-red fix (#6308) * fix(test): gate use std::sync::Arc behind cfg(unix) to complete the Windows-red fix Follow-up to #6306. Gating make_transform_engine left use std::sync::Arc referenced only by Unix-gated code, so the Windows build failed -D warnings with an unused_imports error (the rest of the test module uses fully-qualified std::sync::Arc). The import is now #[cfg(unix)] too. Completes #6304. * style(test): condense two-line Arc comment to one line per project rule --------- Co-authored-by: Evan <[email protected]> Co-authored-by: Claude <[email protected]>
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.
Problem
mainis red (#6304). TheTest / Windowslane fails on both shards, and because Windows/macOS lanes only run onmain's post-merge push CI (not on PR CI, where they areskipping), every PR inherits the failure on its next run.Root cause is not #6299 / #6305 (they only inherited the red). The failing test is from #6291:
The four
transform_tool_result_*tests build a#!/bin/shscript viamake_transform_scriptand run it through the native script runtime as a hook. Windows has no/bin/sh, so the spawn fails: the script-success path (rewrites_content,missing_content_is_noop) breaks its metrics assertions on Windows, one per shard. Linux/macOS pass (4691 passed, 1 failed).Fix
Gate the shell-script test harness behind
#[cfg(unix)]:transform_tool_result_*testsmake_transform_script(already had an inner#[cfg(unix)]for the chmod) andmake_transform_engineuse MemorySubstrate/use ToolExecutionStatusimports — gated too, so Windows doesn't tripunused_imports/dead_codeunder-D warningsThe
transform_tool_resultfeature is unchanged; only this Unix-shell test harness is gated. Coverage stays on Linux and macOS.Verification
#[cfg(unix)]-only. On Linuxcfg(unix)is always true, so the compiled output is identical to the current code — no behavior change on the lanes that were already green.cargo fmt --checkran via the hook's documented soft-skip). The Windows CI lane on this PR is the authoritative check — it must go from red to green.-D warningsfailure.refs #6304