# Description
* The path to the binaries for tests is slightly incorrect. It is
missing the build target when it is set with the `CARGO_BUILD_TARGET`
environment variable. For example, when `CARGO_BUILD_TARGET` is set to
`aarch64-linux-android`, the path to the `nu` binary is:
`./target/aarch64-linux-android/debug/nu`
rather than
`./target/debug/nu`
This is common on Termux since the default target that rustc detects can
cause problems on some projects, such as [python's `cryptography`
package](https://github.com/pyca/cryptography/issues/7248).
This technically isn't a problem specific to Android, but is more likely
to happen on Android due to the latter.
* Additionally, the existing variable named `NUSHELL_CARGO_TARGET` is in
fact the profile, not the build target, so this was renamed to
`NUSHELL_CARGO_PROFILE`. This change is included because without the
rename, the build system would be using `CARGO_BUILD_TARGET` for the
build target and `NUSHELL_CARGO_TARGET` for the build profile, which is
confusing.
* `std path add` tests were missing `android` test
# User-Facing Changes
For those who would like to build nushell on Termux, the unit tests will
pass now.
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx
you can also mention related issues, PRs or discussions!
-->
# Description
`chrono` crate enables `oldtime` feature by default, which has a
vulnerability (https://rustsec.org/advisories/RUSTSEC-2020-0071). This
PR tries to remove `time` v0.1.45 completely from nu and add an audit CI
to check for security vulnerabilities.
✋ Wait for the following PRs:
- [x] https://github.com/nushell/reedline/pull/599
- [x] https://github.com/bspeice/dtparse/pull/44
- [x] https://github.com/Byron/trash-rs/pull/75
- [x] https://gitlab.com/imp/chrono-humanize-rs/-/merge_requests/15
# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library
> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
---------
Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
Developer mode needs to be enabled to create symlinks on Windows. Since
creating symlinks is part of the testbench, this needs to be enabled.
(I always wondered why two tests fail on my Windows machine, but not on
the CI)
# Description
We allowed two default lints due to false positives. This should be
locally addressed with explicit information what causes either a false
positive or why a particular design choice in the code is made.
# User-Facing Changes
None
# Tests + Formatting
We should detect a few more things with clippy out of the box. If you
encounter a false positive you will need to address it on a case by case
basis.
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx
you can also mention related issues, PRs or discussions!
-->
# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.
Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
Winget Releaser now supports non-Windows runners, and `ubuntu-latest` is
generally faster.
related to a comment in https://github.com/nushell/nushell/pull/9500
> `cargo run -- crates/nu-std/tests/run.nu` Not done - doesn't seem to
work
this is absolutely true because the command in the PR template was
obsolete...
i've also updated the commands in the `CONTRIBUTING` document of the
library 👍
cc/ @fnordpig
# Description
this PR is an attempt at making the main CI workflow a bit easier to
read, understand and work with 🤞
## changelog
- remove the deprecated `nu-coverage` job which was taking place for
nothing
- remove useless comments, i.e. comments that just say the same thing as
the line they comment, e.g. the previous `on.push` comment, and comments
that can be explained with a `git blame` inside an IDE, e.g. the comment
about removing `--profile ci` on the `cargo install` in the std job
- rename `nu-fmt-clippy` and `nu-tests` to `fmt-clippy` and `tests` as
we already know we are working with Nushell
- rename the "*style*" to "*feature*" which is exactly what `default`,
`dataframe` and `extra` are
- remove the `strategy.matrix.rust: stable` key: i couldn't find any
documentation for this and it's not used in the jobs => by default, the
toolchain of `actions-rust-lang/setup-rust-toolchain@v1.5.0` is the
stable one (see the
[documentation](https://github.com/actions-rust-lang/setup-rust-toolchain#inputs))
- add a top-level `env` block with all the environment variables, e.g.
`CLIPPY_OPTIONS`, to have them all in one place
hope you'll like that 😇🙏
# User-Facing Changes
# Tests + Formatting
this PR should not change the different jobs being run in PRs and on the
`main` branch.
# After Submitting
# Description
For years, Nushell has used `let-env` to set a single environment
variable. As our work on scoping continued, we refined what it meant for
a variable to be in scope using `let` but never updated how `let-env`
would work. Instead, `let-env` confusingly created mutations to the
command's copy of `$env`.
So, to help fix the mental model and point people to the right way of
thinking about what changing the environment means, this PR removes
`let-env` to encourage people to think of it as updating the command's
environment variable via mutation.
Before:
```
let-env FOO = "BAR"
```
Now:
```
$env.FOO = "BAR"
```
It's also a good reminder that the environment owned by the command is
in the `$env` variable rather than global like it is in other shells.
# User-Facing Changes
BREAKING CHANGE BREAKING CHANGE
This completely removes `let-env FOO = "BAR"` so that we can focus on
`$env.FOO = "BAR"`.
# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library
> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
# After / Before Submitting
integration scripts to update:
- ✔️
[starship](https://github.com/starship/starship/blob/master/src/init/starship.nu)
- ✔️
[virtualenv](https://github.com/pypa/virtualenv/blob/main/src/virtualenv/activation/nushell/activate.nu)
- ✔️
[atuin](https://github.com/ellie/atuin/blob/main/atuin/src/shell/atuin.nu)
(PR: https://github.com/ellie/atuin/pull/1080)
- ❌
[zoxide](https://github.com/ajeetdsouza/zoxide/blob/main/templates/nushell.txt)
(PR: https://github.com/ajeetdsouza/zoxide/pull/587)
- ✔️
[oh-my-posh](https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/src/shell/scripts/omp.nu)
(pr: https://github.com/JanDeDobbeleer/oh-my-posh/pull/4011)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx
you can also mention related issues, PRs or discussions!
-->
# Description
This PR should fix#9565Close#9565
cc @hustcer
# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library
> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
# Description
This PR refactors `cargo-build-nu`
cc @hustcer
# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library
> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
# Description
Prevent `rustflags` build configuration from being ignored in github
actions ci workflows.
[actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain/)
used in ci workflows sets `RUSTFLAGS="-D warnings"` env variable by
default. It has priority over some other sources of `rustflags` as
described in [the cargo
reference](https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags).
Nushell is using `target.x86_64-pc-windows-msvc.rustflags` to statically
link MSVC runtime in windows platform, but this config is being ignored
in ci workflows.
By unsetting `RUSTFLAGS` env variable, `rustflags` build configurations
will be properly used in ci workflows.
I assume that this was the cause of the installer verification failures
on the recent winget submission PRs. For more details, refer discussions
in https://github.com/microsoft/winget-pkgs/pull/106977 and
https://github.com/nushell/nushell/pull/9322#issuecomment-1602932971.
# User-Facing Changes
Pre-built releases for windows that are created by the release ci
workflow will now contain statically linked MSVC runtime.
# Tests + Formatting
Confirmed successful installation in a windows sandbox instance, which
was failing before. It also contains changes made in #9514.
Release ci workflow:
https://github.com/wolimst/nushell/actions/runs/5357440849
Installer: https://github.com/wolimst/nushell/releases/tag/0.81.0-test
# After Submitting
Need to check the installer verification result in a winget submission
PR for the next release, if this PR gets merged.
# Description
The issue template to report a build failure in our nightly-build CI was
also appearing among the options for a user to pick from.
Moved over to a separate folder `.github/AUTO_ISSUE_TEMPLATE`
Bumps
[actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain)
from 1.4.4 to 1.5.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions-rust-lang/setup-rust-toolchain/releases">actions-rust-lang/setup-rust-toolchain's
releases</a>.</em></p>
<blockquote>
<h2>v1.5.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Check that listed components and targets are installed even with a
rust-toolchain file by <a
href="https://github.com/jonasbb"><code>@jonasbb</code></a> in <a
href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/19">actions-rust-lang/setup-rust-toolchain#19</a></li>
<li>allow disabling RUSTFLAGS config by <a
href="https://github.com/JeanMertz"><code>@JeanMertz</code></a> in <a
href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/18">actions-rust-lang/setup-rust-toolchain#18</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/JeanMertz"><code>@JeanMertz</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/pull/18">actions-rust-lang/setup-rust-toolchain#18</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1...v1.5.0">https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1...v1.5.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md">actions-rust-lang/setup-rust-toolchain's
changelog</a>.</em></p>
<blockquote>
<h2>[1.5.0] - 2023-05-29</h2>
<h3>Added</h3>
<ul>
<li>
<p>Support installing additional components and targets that are not
listed in <code>rust-toolchain</code> (<a
href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/14">#14</a>)
Before only the items listed in <code>rust-toolchain</code> were
installed.
Now all the items from the toolchain file are installed and then all the
<code>target</code>s and <code>components</code> that are provided as
action inputs.
This allows installing extra tools only for CI or simplify testing
special targets in CI.</p>
</li>
<li>
<p>Allow skipping the creation of a <code>RUSTFLAGS</code> environment
variable.
Cargos logic for rustflags is complicated, and setting the
<code>RUSTFLAGS</code> environment variable prevents other ways of
working.
Provide a new <code>rustflags</code> input, which controls the
environment variable creation.
If the value is set to the empty string, then <code>RUSTFLAGS</code> is
not created.</p>
<p>Pre-existing <code>RUSTFLAGS</code> variables are never modified by
this extension.</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f3c84ee10b"><code>f3c84ee</code></a>
Merge pull request <a
href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/18">#18</a>
from JeanMertz/rustflags</li>
<li><a
href="1ef811fbfb"><code>1ef811f</code></a>
Restore behavior to not touch existing RUSTFLAGS variable</li>
<li><a
href="70241ab2e9"><code>70241ab</code></a>
fixes</li>
<li><a
href="823a4a135d"><code>823a4a1</code></a>
fixes</li>
<li><a
href="aaa7eef1a2"><code>aaa7eef</code></a>
requred -> required</li>
<li><a
href="24274e4435"><code>24274e4</code></a>
allow disabling <code>RUSTFLAGS</code> config</li>
<li><a
href="cf60eafd0a"><code>cf60eaf</code></a>
Merge pull request <a
href="https://redirect.github.com/actions-rust-lang/setup-rust-toolchain/issues/19">#19</a>
from actions-rust-lang/better-toolchain-support</li>
<li><a
href="289d5e6164"><code>289d5e6</code></a>
Add changelog</li>
<li><a
href="661e2d23dd"><code>661e2d2</code></a>
Explain the new behavior in the README</li>
<li><a
href="b065e5ab9f"><code>b065e5a</code></a>
Install components and targets after installing everything from the
rust-tool...</li>
<li>Additional commits viewable in <a
href="https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.4.4...v1.5.0">compare
view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions-rust-lang/setup-rust-toolchain&package-manager=github_actions&previous-version=1.4.4&new-version=1.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx
you can also mention related issues, PRs or discussions!
-->
# Description
We don't need to modify this file to disable the building of
`riscv64gc-unknown-linux-gnu` and `armv7-unknown-linux-gnueabihf`
binaries, just modify the `.github/workflows/release.yml` file is
enough.
Reset this file to make `.github/workflows/nightly-build.yml` work less
wrong
# Description
Test runner now performs following actions in order to run tests:
* Module file is opened
* Public function with random name is added to the source code, this
function calls user-specified private function
* Modified module file is saved under random name in $nu.temp-path
* Modified module file is imported in subprocess, injected function is
called by the test runner
# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
* Test functions no longer need to be exported
* test functions no longer need to reside in separate test_ files
* setup and teardown renamed to before-each and after-each respectively
* before-all and after-all functions added that run before all tests in
given module. This matches the behavior of test runners used by other
languages such as JUnit/TestNG or Mocha
# Tests + Formatting
# After Submitting
---------
Co-authored-by: Kamil <skelly37@protonmail.com>
Co-authored-by: amtoine <stevan.antoine@gmail.com>
# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.
Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library
> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.
Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library
> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
appears the `nu-coverage` job of the CI has decided to go wild, marking
a lot of runs with ❌, both in PRs and on the `main` branch 😱
this PR tries to mitigate the damage by disabling the pipeline.
> **Note**
> see [*Using conditions to control job
execution*](https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution)
# Description
i've almost always wanted to clean up the root of the repo, so here is
my take at it, with some important advice given by @fdncred 😌
- `README.release.txt` is now gone and directly inline in the
`release-pkg` script used in the `release` *workflow*
- `build.rs` has been moved to `scripts/` and its path has been changed
in
[`Cargo.toml`](https://github.com/amtoine/nushell/blob/refactor/clean-root/Cargo.toml#L3)
according to the [*Build Scripts*
section](https://doc.rust-lang.org/cargo/reference/build-scripts.html#build-scripts)
of *The Cargo Book*
- i've merged `images/` into `assets/` and fix the only mention to the
GIF in the README
- i've moved the `docs/README.md` inside the main `README.md` as a new
[*Configuration*
section](https://github.com/amtoine/nushell/tree/refactor/clean-root#configuration)
- the very deprecated `pkg_mgrs/` has been removed
- all the `.nu`, `.sh`, `.ps1` and `.cmd` scripts have been moved to
`scripts/`
### things i've left as-is
- all the other `.md` documents
- the configuration files
- all the Rust and core stuff
- `docker/`
- `toolkit.nu`
- the `wix/` diretory which appears to be important for `winget`
# User-Facing Changes
scripts that used to rely on the paths to some of the scripts should now
call the scripts inside `scripts/` => i think this for the greater good,
it was not pretty nor scalable to have a bunch of scripts in the root of
our main `nushell` 😱
*i even think we might want to move these scripts outside the main
`nushell` repo*
maybe to `nu_scripts` or some other tool 👍
# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- ⚫ `toolkit test`
- ⚫ `toolkit test stdlib`
# After Submitting
```
$nothing
```
as can be seen
[here](https://github.com/nushell/nushell/labels?q=needs-), i've created
the `needs-triage` and `needs-core-team-attention` labels.
in this PR, i made the `needs-triage` a default label to all the issue
templates 😋
# Description
This PR bumps the rust toolchain from 1.66.1 to 1.67.1
# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library
> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
Move test runner to standard library.
Originated from #8819
# After Submitting
I'll update the documentation about testing:
http://www.nushell.sh/book/testing.html
---------
Co-authored-by: Mate Farkas <Mate.Farkas@oneidentity.com>
# Description
Don't wait for the tests to pass to try running the coverage job. In
theory that would save some wasted runs but waiting for it can also slow
down the review if you want to inspect that a certain branch is covered
by tests.
# Tests + Formatting
Coverage runs immediately and can also fail due to failing tests
# Description
Let's see if we don't run out of disk space as quickly again
This reverts commit 0e496f900d.
(#8677)
# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
# Tests + Formatting
Same coverage setup as before
# Description
i sometimes see some sections of the PR template being left untouched by
contributors 🤔
this is not a big deal at all, but i thought we could hide them in the
final PR by making the italic hints real markdown comments with the
`<!-- ... -->` syntax.
this has the effect of
- still showing the guidelines to the contributor in the PR creation
window
- not show these guidelines in the visible PR body
> **Warning**
> limitations
> - this won't remove the comments from the squashed commit when the PR
lands 🤔
> - we might need to use a more structured template for this, like in
the [feature
requests](https://github.com/nushell/nushell/issues/new?assignees=&labels=enhancement&template=feature_request.yml)
but i'm not sure this works with PR templates 😕
# User-Facing Changes
```
$nothing
```
# Tests + Formatting
```
$nothing
```
# After Submitting
```
$nothing
```
# Description
Upgrade to nu v0.78 for binary packages release workflow
Test Release: https://github.com/hustcer/nu-release/releases/tag/v0.78.2
Release workflow running output:
https://github.com/hustcer/nu-release/actions/runs/4656319252/jobs/8239828202
# User-Facing Changes
_(List of all changes that impact the user experience here. This helps
us keep track of breaking changes.)_
# Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library
> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
# After Submitting
If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
# Description
as we now have a prelude thanks to #8627, i'd like to work on the
structure of the library 😋
and i think the first step is to make it a true standalone crate 😏
this PR
- moves all the library from `crates/nu-utils/standard_library/` to
`crates/nu-std/`
- moves the `rust` loading code from `src/run.rs` to
`crates/nu-std/src/lib.rs`
# Description
The coverage testing on CI has been broken for at least a week. It looks
like we might have to do some work, but for now, disabling it so we
don't give bad stability info to contributors.
# User-Facing Changes
_(List of all changes that impact the user experience here. This helps
us keep track of breaking changes.)_
# Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-utils/standard_library/tests.nu` to run the
tests for the standard library
> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
# After Submitting
If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
Related to #8525.
# Description
With #8525, the tests for the standard library have been enabled in the
CI.
The only places where these tests are missing are
- the PR template
- the toolkit
This PR adds
- `cargo run -- crates/nu-utils/standard_library/tests.nu` to the PR
template
- the same command as `toolkit test stdlib`
- the `test stdlib` command to `toolkit check pr`
# User-Facing Changes
```
$nothing
```
# Tests + Formatting
the new output of `toolkit check pr`, with the same color code:
> - 🟢 `toolkit fmt`
> - 🟢 `toolkit clippy`
> - 🟢 `toolkit test`
> - 🟢 `toolkit test stdlib`
# After Submitting
```
$nothing
```
Should close one of the tasks in #8450.
# Description
> **Note**
> in order of appearance in the global diff
- 1b7497c419 adds the `std-tests` job to
the CI which
1. installs `nushell` in the runner
2. run the `tests.nu` module
> see `open .github/workflows/ci.yml | get jobs.std-tests | to yaml`
-
[`ec85b6fd`..`9c122115`](ec85b6fd3fc004cd94e3fada5c8e5fe2714fd629..9c12211564ca8ee90ed65ae45776dccb8f8e4ef1)
is where all the magic happens => see below
- 🧪799c7eb7fd introduces some
bugs and failing test to see how the CI behaves => see how the [tests
failed](https://github.com/nushell/nushell/actions/runs/4460098237/jobs/7833018256)
as expected ❌
- 🧪 and c3de1fafb5 reverts the
failing tests, i.e. the previous commit, leaving a standard library
whose tests all pass 🎉 => see the [tests
passing](https://github.com/nushell/nushell/actions/runs/4460153434/jobs/7833110719?pr=8525#step:5:1)
now ✔️
## the changes to the runner
> see
[`ec85b6fd`..`9c122115`](ec85b6fd3fc004cd94e3fada5c8e5fe2714fd629..9c12211564ca8ee90ed65ae45776dccb8f8e4ef1)
the issue with the previous runner was the following: the clever trick
of using `nu -c "use ...; test"` did print the errors when occuring but
they did not capture the true "failure", i.e. in all cases the
`$env.LAST_EXIT_CODE` was set to `0`, never stopping the CI when a test
failed 🤔
i first tried to `try` / `catch` the error in
ec85b6fd3f which kinda worked but only
throw a single error, the first one
i thought it was not the best and started thinking about a solution to
have a complete report of all failing tests, at once, to avoid running
the CI multiple times!
the easiest solution i found was the one i implemented in
9c12211564
> **Warning**
> this changes the structure of the runner quite a bit, but the `for`
loops where annoying to manipulate structured data and allow the runner
to draw a complete report...
now the runner does the following
- compute the list of all available tests in a table with the `file`,
`module` and `name` columns (first part of the pipe until `flatten` and
`rename`)
- run the tests one by one computing the new `pass` column
- with a `log info`
- captures the failing ones => puts `true` in `pass` if the test passes,
`false` otherwise
- if at least one test has failed, throw a single error with the list of
failing tests
### hope you'll like it 😌
# User-Facing Changes
```
$nothing
```
# Tests + Formatting
the standard tests now return a true error that will stop the CI
# After Submitting
```
$nothing
```
i was writing #8148 and came to the "_Test + Formatting_" section of the
PR template.
i felt the developer instructions could be wrapped up in a common easy
to use format, e.g. a `Makefile`, to be used with a few-words command
only, e.g. `make fmt` or `make clippy`, instead of the long commands in
the PR template 🤔
> **Note**
> in case you guys do not want to add a `Makefile` to the `nushell`
source, that PR can be discarded 😌
# Description
this PR
- adds the few rules from the PR template to a new `Makefile`
- replaces the instructions in the PR template from the full commands to
the new `make` rules
# User-Facing Changes
- _none for the regular user_
- i believe easier to test PRs for the developer, allowing one not to
realy on knowing the long commands or using the shell history to run
them again 😋
# Tests + Formatting
_nothing to test_
# After Submitting
maybe mention that in `CONTRIBUTING.md`?