-
-
Notifications
You must be signed in to change notification settings - Fork 769
fix(nushell): add missing | parse env | update-env for deactivation operations
#6994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jdx
merged 5 commits into
jdx:main
from
jokeyrhyme:fix-nushell-generate-valid-deactivate-statements-for-nushell-0-108-0
Nov 18, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
accef33
fix(nushell): add optional end-to-end test stub
jokeyrhyme 3d557db
fix(nushell): e2e test for nushell without deactivation
jokeyrhyme 06e748b
fix(nushell): add (failing) e2e test for nushell deactivation
jokeyrhyme 9c62fb3
fix(nushell): add missing `parse env` for deactivation operations
jokeyrhyme fa24ac2
chore(ci): install nushell for coverage tests
jokeyrhyme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #! /usr/bin/env sh | ||
|
|
||
| # run this test with either: | ||
| # - mise run e2e nushell | ||
| # - LD_LIBRARY_PATH=/usr/lib:/home/linuxbrew/.linuxbrew/lib mise run e2e nushell | ||
|
|
||
| set -eu | ||
|
|
||
| if ! command -v nu >/dev/null 2>&1; then | ||
| # for now, treat these tests as optional if `nu` is unavailable | ||
| exit 0 | ||
| fi | ||
|
|
||
| MISE_NUSHELL_INIT=$(mktemp e2e_nushell_init.XXXXXXXXXX) | ||
|
|
||
| # nushell's `source` is a parser keyword: | ||
| # https://www.nushell.sh/commands/docs/source.html | ||
| # this means the sourced mise init file must exist before we run `nu` | ||
|
|
||
| # use `env` to control the environment variables available to `nu` | ||
| # - we need LD_LIBRARY_PATH so that mise can find libbz2.so.1.0 | ||
| # - we need PATH so that this test can find `mise` | ||
| env --ignore-environment LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" PATH="${PATH}" mise activate nu >"${MISE_NUSHELL_INIT}" | ||
|
|
||
| # equivalent of try/catch so we always cleanup the temporary file, | ||
| # even if the test fails | ||
| set +e | ||
|
|
||
| # use `env` to control the environment variables available to `nu` | ||
| # - we need LD_LIBRARY_PATH so that mise can find libbz2.so.1.0 | ||
| # - we need PATH so that this test can find `nu` | ||
| env --ignore-environment LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" PATH="${PATH}" nu --no-config-file --commands "source ${MISE_NUSHELL_INIT}" | ||
| NUSHELL_EXIT_CODE=${?} | ||
|
|
||
| set -e | ||
| rm --force --verbose "${MISE_NUSHELL_INIT}" | ||
|
|
||
| exit "${NUSHELL_EXIT_CODE}" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #! /usr/bin/env sh | ||
|
|
||
| # run this test with either: | ||
| # - mise run e2e nushell | ||
| # - LD_LIBRARY_PATH=/usr/lib:/home/linuxbrew/.linuxbrew/lib mise run e2e nushell | ||
|
|
||
| set -eu | ||
|
|
||
| if ! command -v nu >/dev/null 2>&1; then | ||
| # for now, treat these tests as optional if `nu` is unavailable | ||
| exit 0 | ||
| fi | ||
|
|
||
| MISE_NUSHELL_INIT=$(mktemp e2e_nushell_init.XXXXXXXXXX) | ||
|
|
||
| # nushell's `source` is a parser keyword: | ||
| # https://www.nushell.sh/commands/docs/source.html | ||
| # this means the sourced mise init file must exist before we run `nu` | ||
|
|
||
| # use `env` to control the environment variables available to `nu` | ||
| # - we need __MISE_DIFF to trigger the deactivation code path | ||
| # - we need LD_LIBRARY_PATH so that mise can find libbz2.so.1.0 | ||
| # - we need PATH so that this test can find `mise` | ||
| env --ignore-environment __MISE_DIFF=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" PATH="${PATH}" mise activate nu >"${MISE_NUSHELL_INIT}" | ||
|
|
||
| # equivalent of try/catch so we always cleanup the temporary file, | ||
| # even if the test fails | ||
| set +e | ||
|
|
||
| # use `env` to control the environment variables available to `nu` | ||
| # - we need LD_LIBRARY_PATH so that mise can find libbz2.so.1.0 | ||
| # - we need PATH so that this test can find `nu` | ||
| env --ignore-environment LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" PATH="${PATH}" nu --no-config-file --commands "source ${MISE_NUSHELL_INIT}" | ||
| NUSHELL_EXIT_CODE=${?} | ||
|
|
||
| set -e | ||
| rm --force --verbose "${MISE_NUSHELL_INIT}" | ||
|
|
||
| exit "${NUSHELL_EXIT_CODE}" |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you mind adding nushell to either the coverage github action tests or mise.toml so they actually get run in CI? these tests otherwise won't do any good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing!
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, any special reason why the Windows end-to-end tests were automated via GitHub Actions, but not the rest of the end-to-end tests?
edit: ignore me, i found them in the "nightly" Action, although they don't seem to log any output to stdout which is intriguing ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mise run e2e --listworks on my machine and outputs the full list to stdouti'm not sure
mise run e2e(what is already in "nightly") or evenmise run e2e --allactually does anything at the moment ...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdx well, i've explicitly added the nushell end-to-end tests in "nightly", but i think a follow-up PR is needed to fix the rest of the end-to-end tests, unless you're okay with only the nushell ones running? 🤷