hide std testing (#11331)

follow-up to
- https://github.com/nushell/nushell/pull/11151

> **Important**
> land only between 0.89 and 0.90

# Description
this PR hides the `std testing` module from the outside.
- moves `nu-std/std/testing.nu` to `nu-std/testing.nu`
- removes the module from the standard library list of modules to parse
- fixes `toolkit.nu` and the CI

# User-Facing Changes
`std testing` won't be part of the standard library anymore.
# Tests + Formatting

# After Submitting
This commit is contained in:
Antoine Stevan 2024-01-25 11:50:07 +01:00 committed by GitHub
parent cffce7f4b2
commit ef1d70eb67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 14 deletions

View File

@ -129,7 +129,7 @@ jobs:
run: cargo install --path . --locked --no-default-features
- name: Standard library tests
run: nu -c 'use std testing; testing run-tests --path crates/nu-std'
run: nu -c 'use crates/nu-std/testing.nu; testing run-tests --path crates/nu-std'
- name: Setup Python
uses: actions/setup-python@v5

View File

@ -18,7 +18,6 @@ pub fn load_standard_library(
let mut std_files = vec![
("mod.nu", include_str!("../std/mod.nu")),
("testing.nu", include_str!("../std/testing.nu")),
("dirs.nu", include_str!("../std/dirs.nu")),
("dt.nu", include_str!("../std/dt.nu")),
("help.nu", include_str!("../std/help.nu")),

View File

@ -1,4 +1,4 @@
use log.nu
use std/log.nu
def "nu-complete threads" [] {
seq 1 (sys|get cpu|length)
@ -287,16 +287,6 @@ 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)
# Can't use pattern matching here due to https://github.com/nushell/nushell/issues/9198

View File

@ -107,7 +107,10 @@ export def test [
export def "test stdlib" [
--extra-args: string = ''
] {
cargo run -- -c $"use std testing; testing run-tests --path crates/nu-std ($extra_args)"
cargo run -- -c $"
use crates/nu-std/testing.nu
testing run-tests --path crates/nu-std ($extra_args)
"
}
# formats the pipe input inside backticks, dimmed and italic, as a pretty command