Repository navigation
fix(tests): isolate cli_tests from host Winuxsh install env - #996
Merged
Merged
Conversation
- spawn every cli_tests engine process through a rubash_command() helper that strips WINUXSH_ROOT / __RUBASH_SHELL_ROOT, so hosts with a Winuxsh install root exported exercise this checkout, not the installed tree - name fd_redirects external-fd-copy bin dirs without ThreadId Debug: ThreadId(N) puts brackets in a PATH entry and Windows .cmd resolution through such a path fails - lowercase only the drive letter in the login-shell $0 expectation, matching the engine's display-path behavior and the bashdb_compat convention - skip the gawk -F escape pipeline probe when no awk is reachable from the sanitized environment; a missing host tool is not a regression
- script_file_accepts_shell_style_drive_path: gate the drive-letter normalization on cfg(windows); on Linux/macOS niu is the forward-slash argv spelling verbatim, the unconditional [..1]/[3..] slicing turned /home/... into ///me/... and would fail non-Windows CI. - scripts.rs nested THIS_SH probe now spawns through rubash_command() (strips host-install env) and keeps the forward-slash THIS_SH value; its Command import is gone. - compat_issue_regressions ash-named probe (cfg(not(windows))) strips WINUXSH_ROOT/__RUBASH_SHELL_ROOT too, with a cfg-gated Command import so the file compiles on non-Windows hosts.
Contributor
|
欢迎!这是你的第一个 PR 🎉 请确认已跑过本地测试套件;CI 通过后维护者会 review。 |
caomengxuan666
added a commit
that referenced
this pull request
Oct 22, 2026
- finalize the 10-22 batch into [1.4.3]: the command-stem ASCII case fold (#998/#1000), the interactive ${v^^} crash fix (niubash#503), cli_tests isolation (#996), the no-IFS short-circuit re-land (#995/#1002), and the assoc/signal/test-bench perf batch - backfill the missing [1.4.2] and [1.4.1] sections from the tag boundaries (the bump-only releases left them unwritten) - PROJECT version 1.4.2 -> 1.4.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cli_testsfails on Windows hosts that have a Winuxsh/niubash install, even though the engine is fine. This PR fixes the test isolation; no engine code changes.WINUXSH_ROOTto the user environment. The root resolution order is__RUBASH_SHELL_ROOT > WINUXSH_ROOT > RUBASH_ROOT, so the fixture'sRUBASH_ROOTgot shadowed (e.g.tilde_user×3 expanding against the installed tree). Allcli_testsengine spawns now go through arubash_command()helper that stripsWINUXSH_ROOT/__RUBASH_SHELL_ROOT.ThreadId(N)Debug output; Windows.cmdresolution through a PATH entry containing brackets fails (fd_redirects×10). Bin dirs now use a bracket-free name.$0drive-path expectation:script_file_accepts_shell_style_drive_pathlowercased the whole expected path, while the engine keeps the original case and lowercases only the drive letter. Now only the drive letter is normalized, gated oncfg(windows)(non-Windows expects the argv spelling verbatim), matching thebashdb_compatconvention.-Fescape pipeline probe is skipped when no awk is reachable from the sanitized environment; a missing host tool is not a regression.THIS_SHprobe (scripts.rs) and thecfg(not(windows))ash probe incompat_issue_regressions.rsalso strip the host-install env.Test plan
WINUXSH_ROOTexported,NIU_SHELL=target/debug/rubash.exe:cli_tests471 passed / 11 faileddac428cc): 482 passed / 0 failed / 2 ignoredcargo fmt --checkclean; non-Windows branches compile-checked by review.