fix(ci): gate the unix-only gh test recorder so the Windows test binary compiles

Root cause of the unexplained red Test (windows-latest) on #5135, present
since before the strip: install_recording_gh and close_input_with_dry_run
in crates/tui/src/tools/github/mod.rs are consumed only by #[cfg(unix)]
tests (the recorder is a sh script), but the helpers themselves were
ungated. On Windows they compile as dead code and -D warnings fails the
whole test-binary build — which is why the job's visible log tail showed
passing suites with no failing test: the binary never built. Gating both
helpers #[cfg(unix)] matches their consumers.

Verified: tools::github tests green on macOS, clippy --all-targets
-Dwarnings clean. Windows proof is the CI matrix on this push. Authored
with agent assistance (Claude).
This commit is contained in:
Hmbown
2026-08-04 08:50:24 -07:00
parent dc65ac4730
commit 7e73d34dad
+5
View File
@@ -386,6 +386,10 @@ mod tests {
///
/// The close path must never reach a real `gh`, so the recorder both
/// proves what was attempted and keeps the test from touching GitHub.
/// Unix-only like its consumers: the recorder is a `sh` script, and on
/// Windows the ungated helper is dead code that fails `-D warnings` —
/// this was the unexplained red `Test (windows-latest)` on #5135.
#[cfg(unix)]
fn install_recording_gh(dir: &std::path::Path, log: &std::path::Path) -> PathBuf {
let bin = dir.join("gh-recorder.sh");
std::fs::write(
@@ -405,6 +409,7 @@ mod tests {
bin
}
#[cfg(unix)]
fn close_input_with_dry_run(dry_run: Value) -> Value {
json!({
"number": 424_242,