Repository navigation
test: run a real Nushell in CI and the CLI tests on Windows - #753
Merged
linghengqian merged 1 commit intoNov 12, 2026
Merged
linghengqian merged 1 commit into
linghengqian merged 1 commit into
Conversation
Part of version-fox#737 (section 5, smaller items). Nushell: the vfox.nu that vfox generates was only checked as text, but whether `vfox env` sees the __VFOX_ORIG_PATH that the script records shows only in the order of PATH that a real session ends up with. A new job installs a pinned Nushell release (the digest of the archive is checked), and TestNushellSessionUsesTheBaselineItRecorded builds vfox, generates the configuration the documented way, starts nu on it and checks the PATH of the session for the default (baseline) and the legacy mode. The test skips without nu; the job sets VFOX_TEST_NUSHELL=1, so that a missing nu fails. Windows: cliFixture skipped there, so the junction, .cmd and PATH separator cases had no end-to-end coverage. The fixture now sets USERPROFILE, writes commands with an extension from PATHEXT, spells PATH the way each shell gets it (';' natively, /c/... for the bash hook), makes links with junctions and hard links, resolves the short name in TEMP and names directories with os.MkdirTemp. Selecting an SDK globally writes the user's PATH in the registry on Windows, so the fixture runs there only with VFOX_TEST_WINDOWS_REGISTRY=1, which the build job sets. Two tests are new: the PowerShell spelling of PATH, and a baseline in the form Git Bash holds it (Windows only; the situation of version-fox#732).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #753 +/- ##
=======================================
Coverage 56.21% 56.21%
=======================================
Files 115 115
Lines 8576 8576
=======================================
Hits 4821 4821
Misses 3291 3291
Partials 464 464 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
linghengqian
commented
Nov 11, 2026
linghengqian
left a comment
Member
Author
There was a problem hiding this comment.
CC @version-fox/vfox-committers @version-fox/vfox-maintainers . Please help review it.
aooohan
approved these changes
Nov 12, 2026
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.
Fixes #737: these are the last two unticked items of the issue (section 5, smaller items).
A real Nushell in CI
The
vfox.nuthat vfox generates was only checked as text. Whethervfox envsees the__VFOX_ORIG_PATHthat the script records shows only in the order of PATH that a real session ends up with.TestNushellSessionUsesTheBaselineItRecordedbuilds vfox, generates the configuration the documented way (vfox activate nushell $nu.default-config-dir), startsnuon it, and checks the PATH of the session when it starts and after a directory was put in front and the prompt hook ran, for the default (baseline) and for thelegacymode. Deleting the line that records the baseline, or moving it behind the firstenvcall, makes it fail.The new
nushelljob installs Nushell 0.117.0 from its release archive and checks the SHA-256 of the archive first (the digest is listed on the release page; bump both together). The test skips whennuis not installed, and the job setsVFOX_TEST_NUSHELL=1so that an installation that went wrong fails instead of skipping.If #720 lands, this job runs its template change against a real
nu.The CLI tests on Windows
cliFixtureskipped on Windows, so the junction,.cmdand PATH separator cases had no end-to-end coverage. It runs there now:USERPROFILEis set (os.UserHomeDirreads it, notHOME), commands are.cmdfiles (Windows only runs files with aPATHEXTextension), PATH is spelled the way each shell gets it (;natively,/c/...for the bash hook), links are junctions and hard links (no privilege needed), the short name inTEMPis resolved, and directories are named withos.MkdirTempinstead of the clock.VFOX_TEST_WINDOWS_REGISTRY=1, which thebuildjob sets. Someone who runsgo test ./...on a Windows machine skips these tests, as before.vfox use java@Xdoesn't changejavawhen a JDK is in the system PATH and a global SDK is set #732).TestInstallCommandUseOnShellWithoutHookSaysWhatFailedis skipped on Windows: without a hookusefalls back to the global scope and opens a shell.AGENTS.mdsays how to write CLI tests that work there.Verification
go test ./cmd/commandswith Nushell 0.117.0 on PATH, also with-raceand with-shuffle=on -count=3.nushelljob included (run). In its Windowsbuildjobcmd/commandstook 13.9 s at 52.3% coverage (Linux: 1.9 s at 54.5%).windows-latest, from a throwaway fork branch (verbose run, which fails on purpose after printing every test; the real exit code was 0): 192 tests and subtests, 179 passed, 13 skipped, none failed. The skips are the Unix-only environment fixture inenv_test.go, the no-hookinstall -utest, and the Nushell test. That branch carries the same tests. It differs in that the gate of the fixture also opens underGITHUB_ACTIONS(it could not carry the workflow change) and in an extra file that prints the tests. Its plain runs ofcmd/commandstook 10.6 s and 14.6 s, both at the same 52.3% coverage.Not covered: Nushell runs on Linux only, so the
Pathand;branch of the template for Windows is not exercised.