fix(tests): remove hardcoded GNU coreutils dependencies on Windows (#293) - #314
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
WalkthroughTests replace platform-specific ChangesCross-platform test portability
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR replaces GNU coreutils commands (
Confidence Score: 5/5Safe to merge — only test helpers are touched; no production code is changed. Both changes are straightforward cross-platform substitutions. The sleep/true GNU coreutils calls are replaced with sys.executable invocations that work identically on all platforms. The added finally block is a net improvement that prevents zombie test processes. The removed _dead_pid() in test_cleanup.py was genuinely dead code with no callers in that file. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| tests/test_runs.py | Replaces subprocess.Popen(["sleep", "30"]) with a cross-platform Python-based sleep subprocess and adds a finally block to clean up the process on test failure |
| tests/test_cleanup.py | Removes the unused _dead_pid() helper (which relied on true) and its import subprocess statement; the function is not called anywhere in this file |
Reviews (3): Last reviewed commit: "fix(tests): delete the uncalled _dead_pi..." | Re-trigger Greptile
7cdef07 to
bb7bfef
Compare
…iew) test_cleanup.py's _dead_pid has never had a call site: 62818ed created the file by copying the helper out of test_runs.py — `Popen(["true"])` body and all — but never wrote one, and the count has stayed at the bare `def` ever since. So it was not part of bmad-code-org#293's failure set: an uncalled helper cannot resolve `true` on any PATH, which is also why bmad-code-org#31 fixed only the live copy when it added the native-Windows lane, and why three weeks of that lane never flagged it. Porting it would re-apply bmad-code-org#31's fix to code that never runs and re-sync a duplicate of test_runs.py:42 — recreating the duplication that let it drift. Delete it and its now-unused `import subprocess` instead; the coreutils dependency goes away either way. Also bound the new cleanup `wait()` in test_stop_run_signals_live_process, which every other wait in that file and in test_process_host.py already does.
|
Reviewed — approach is right, and I pushed one follow-up commit (6454a6a). The rebase landed well. You beat me to it; your What I changed: That means it was never part of #293's failure set — an uncalled helper can't fail to resolve Also bounded the The One thing left, and CI can't do it. All checks green is not evidence for this issue — GitHub's from a shell without Green here: full suite |
|
Verified on native Windows, stock PATH. @pbean ran this on a Windows VM (PowerShell, CPython 3.13 via uv, no Before —
After — this branch ( Full #293 surface, same shell: So #293 is genuinely closed. 👍 One confirmed side-observation, for a follow-up — not this PR. That Not a regression ( |
|
Filed the follow-up as #319 ( |
Summary
Two tests depended on GNU coreutils being resolvable on Windows PATH:
tests/test_runs.py::test_stop_run_signals_live_processspawnedsubprocess.Popen(["sleep", "30"]).tests/test_cleanup.py::_dead_pid()spawnedsubprocess.Popen(["true"]).On stock Windows environments without
Git\usr\binon PATH, these failed withFileNotFoundErroror exit code 9009 ('true' is not recognized as an internal or external command).Changes
test_stop_run_signals_live_processto usesys.executablewithimport time; time.sleep(30)and added process cleanup in afinallyblock._dead_pidintests/test_cleanup.pyto spawnsys.executablewith"".The
tests/test_verify.pyhalf of the original diff (true/falseverify commands) landed on main via #308, so this branch was rebased onto it and now carries only the twoPopencall sites.Fixes #293
Summary by CodeRabbit