Skip to content

Commit

Permalink
deprecate std testing (nushell#11151)
Browse files Browse the repository at this point in the history
# Description
this PR deprecates the `std testing` module in favor of Nupm.
the plan is to simply hide the module to the user but still use it
internally when running the tests so that
- users don't start to use this module and rather focus on Nupm
- devs don't have to install anything to run the tests locally, they can
just use `toolkit test stdlib` for instance

the deprecation message will be very similar to
nushell#11097

> **Note**
> to demonstrate that the removal of such a command from the exposed
modules of `std` will be transparent and not require the user to install
anything, i have it [prepared in a branch based on this
PR](amtoine/nushell@deprecate-std-testing...amtoine:nushell:hide-std-testing)
> running `toolkit test stdlib` will run the standard library tests
without an issue and yet `use std testing` won't work 👌

# User-Facing Changes
`std testing run-tests` will be removed in `0.90`

# Tests + Formatting

# After Submitting
  • Loading branch information
amtoine committed Dec 2, 2023
1 parent 5c07e82 commit 76bdda1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/nu-std/std/testing.nu
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ export def run-tests [
--list, # list the selected tests without running them.
--threads: int@"nu-complete threads", # Amount of threads to use for parallel execution. Default: All threads are utilized
] {
print $"Warning: (char -u 26a0) (ansi yellow_bold)deprecated_module(ansi reset)"
print "| the `std testing run-tests` command is deprecated and will be removed in Nushell 0.90"
print ""
print $"(ansi cyan)help(ansi reset): please use (ansi {fg: cyan, attr: du})[`nushell/nupm`]\(https://github.com/nushell/nupm\)(ansi reset)"
print ""
print $"(ansi default_dimmed)|(ansi reset) (ansi {fg: 'cyan', attr: 'b'})Note(ansi reset)"
print $"(ansi default_dimmed)| Nupm is still a work in progress and is NOT production-ready, just as `run-tests` is.(ansi reset)"
print $"(ansi default_dimmed)| Please keep in mind that Nupm will change a lot in the near future and we can't recommend it for now.(ansi reset)"
print $"(ansi default_dimmed)| However, if you like bleeding edge software and want to give it a spin, we would welcome feedbacks and ideas :pray:(ansi reset)"

let available_threads = (sys | get cpu | length)

Expand Down

0 comments on commit 76bdda1

Please sign in to comment.