Skip to content

test(windows): stop skipping the whole integration suite on Windows - #3622

Open
rhishi99 wants to merge 1 commit into
rtk-ai:developfrom
rhishi99:test/windows-coverage
Open

rhishi99 wants to merge 1 commit into
rtk-ai:developfrom
rhishi99:test/windows-coverage

Conversation

@rhishi99

Copy link
Copy Markdown
Contributor

Problem

Five of the six files in tests/ open with #![cfg(unix)]. The Windows CI job compiles the binary and then exercises none of it — every suite reports 0 passed:

Running tests\grep_context_test.rs
test result: ok. 0 passed; 0 failed
Running tests\search_faithful_test.rs
test result: ok. 0 passed; 0 failed

Every Windows regression the suite could have caught shipped instead.

The gate was never about Unix

Each of these tests shells out to grep or rg and already skips itself when that engine is missing. The #![cfg(unix)] was a blunt stand-in for "needs a search engine". Removing it means the files run wherever an engine exists — Git Bash, scoop, MSYS2, most Windows developer machines — and skip exactly as they already do on a Linux box without ripgrep.

Result on this machine: 70 integration tests that previously never ran now execute and pass.

Suite Before After
grep_context_test 0 6
grep_faithful_format_test 0 11
search_compress_test 0 14
search_error_test 0 5
search_faithful_test 0 15
windows_smoke_test (new) — 6

Two supporting fixes

  • search_error_test pins CLAUDE_CONFIG_DIR at a path that does not exist. Its assertions require empty stderr, which a developer who has Claude Code installed but not the rtk hook cannot satisfy. CI passes either way only because a fresh runner has no ~/.claude at all.
  • nul.txt → nul_bytes.txt. nul is a reserved device name on Windows; a file by that name cannot be created.

New: tests/windows_smoke_test.rs

Covers what is genuinely Windows-specific rather than merely untested: CRLF line endings, backslash paths, and paths containing spaces. It redirects the tracking DB into a temp dir so a test run never writes to the developer's own history.

Scope

Deliberately excluded: end-to-end tests for rtk tree and rtk summary shell routing. Those depend on #3616 and #3618 and would fail on this base. Both behaviours already have unit tests inside their own PRs, so nothing is left uncovered — only the end-to-end duplicate is deferred.

Testing

Full suite on x86_64-pc-windows-gnu: 2615 passed plus the 70 above. cargo fmt --check and cargo clippy --all-targets clean. The single unrelated failure on this toolchain is fixed in #3615.

🤖 Generated with Claude Code

Five of the six files in `tests/` open with `#![cfg(unix)]`, so the
Windows CI job compiled the binary and then exercised none of it. Every
Windows regression the suite could have caught shipped instead.

The gate was never really about Unix. Each of these tests shells out to
`grep` or `rg` and already skips itself when that engine is missing, so
the files run as-is wherever an engine exists -- including Git Bash,
scoop, and WSL-adjacent setups, which is most Windows developer machines.
Where no engine is installed the tests skip exactly as they already do on
a Linux box without ripgrep.

Two supporting changes:

- `search_error_test` pins `CLAUDE_CONFIG_DIR` at a path that does not
  exist. Its assertions require empty stderr, which a developer with
  Claude Code installed but without the rtk hook cannot satisfy. CI
  passes either way only because a fresh runner has no `~/.claude`.
- Renames a `nul.txt` fixture to `nul_bytes.txt`. `nul` is a reserved
  device name on Windows and cannot be created as a file.

Adds `tests/windows_smoke_test.rs` for the behaviours that are genuinely
Windows-specific rather than merely untested: CRLF line endings,
backslash paths, paths containing spaces, and which shell `rtk summary`
hands a command to.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Aug 20, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants