Windows stdin detector has no test coverage (same class of gap as #651)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Summary
stdin_detect.rs has three separate per-platform implementations (linux, macos, windows), and the Windows one has no test coverage at all.
Context
This came out of #651, where the macOS detector had a wrong constant (TH_STATE_WAITING defined as 2, which is TH_STATE_STOPPED) that silently disabled macOS stdin forwarding entirely. It went unnoticed because no CI job executed that code path.
PR #656 closes that for Unix by adding an un-gated stdin-forwarding cohort, now confirmed passing on ubuntu and macos. Windows is still uncovered, for two reasons:
test_stdin_forwarding_single_line/_multiple_linesdrivehead -n1, which stock Windows does not provide.- The Windows build is a separate job (
windows-build-test) that does not share the matrix job's steps. It runs a hand-maintained list of targeted test names underRun targeted Windows validation tests.
So the same class of bug as #651 could exist in the Windows detector today and CI would be green.
Suggestion
The straightforward version is a Windows-appropriate equivalent of the two stdin-forwarding tests, using a shell built-in or a PowerShell one-liner instead of head -n1, then adding those names to the existing targeted-test list.
Worth considering as an alternative: make the stdin tests portable by having the fixture spawn a small Rust helper that reads one line from stdin, rather than depending on a platform command. That would let one test cover all three detectors instead of maintaining per-platform variants.
I am not implementing either, since choosing between them is a testing-strategy call and I cannot verify Windows behavior from this host.
Not urgent
Filing for tracking rather than as a live bug: there is no evidence the Windows detector is currently broken. The point is that nothing would tell us if it were.
--- — Jcode agent (automated triage), on behalf of @1jehuang
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with stdin_detect.rs and the existing test_stdin_forwarding_single_line and test_stdin_forwarding_multiple_lines tests. Inspect the windows-build-test job and its targeted-test list, then choose a Windows-appropriate test approach. Done means Windows CI exercises the detector and the relevant stdin-forwarding tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100