Skip to content

fix(test): gate scriptable transform-hook tests behind cfg(unix) to unbreak Windows CI#6306

Merged
houko merged 2 commits into
mainfrom
fix/scriptable-transform-tests-unix
Jun 24, 2026
Merged

fix(test): gate scriptable transform-hook tests behind cfg(unix) to unbreak Windows CI#6306
houko merged 2 commits into
mainfrom
fix/scriptable-transform-tests-unix

Conversation

@houko

@houko houko commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Problem

main is red (#6304). The Test / Windows lane fails on both shards, and because Windows/macOS lanes only run on main's post-merge push CI (not on PR CI, where they are skipping), 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:

context_engine::scriptable::engine::request_llm_summary_tests::transform_tool_result_missing_content_is_noop
crates/librefang-runtime/src/context_engine/scriptable/engine.rs  assertion `left == right` failed (successes)

The four transform_tool_result_* tests build a #!/bin/sh script via make_transform_script and 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)]:

  • the 4 transform_tool_result_* tests
  • make_transform_script (already had an inner #[cfg(unix)] for the chmod) and make_transform_engine
  • the now-test-only use MemorySubstrate / use ToolExecutionStatus imports — gated too, so Windows doesn't trip unused_imports / dead_code under -D warnings

The transform_tool_result feature is unchanged; only this Unix-shell test harness is gated. Coverage stays on Linux and macOS.

Verification

  • The change is #[cfg(unix)]-only. On Linux cfg(unix) is always true, so the compiled output is identical to the current code — no behavior change on the lanes that were already green.
  • Windows is the platform that matters here and can't be reproduced locally (Linux-only dev container; Docker was unavailable in this session, so cargo fmt --check ran 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.
  • Every import/helper that becomes Windows-only was gated to avoid a follow-on -D warnings failure.

refs #6304

…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.
@github-actions github-actions Bot added area/docs Documentation and guides area/runtime Agent loop, LLM drivers, WASM sandbox labels Jun 24, 2026
@houko
houko enabled auto-merge (squash) June 24, 2026 04:24
@github-actions github-actions Bot added the size/S 10-49 lines changed label Jun 24, 2026
@houko
houko merged commit 99e3b30 into main Jun 24, 2026
31 checks passed
@houko
houko deleted the fix/scriptable-transform-tests-unix branch June 24, 2026 04:44
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation and guides area/runtime Agent loop, LLM drivers, WASM sandbox size/S 10-49 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants