std lib: extend test runner capabilities#8499
Conversation
- run tests within a given folder - select test module to run tests within - select test command to run
|
the tests of the existing library are broken, let me fix them and i'll come back to this PR right after the changes have been applied 😉 |
|
in the meantime, to help the developer trying to run the new tests runner, i think a and also allowing to pass multiple modules and commands maybe? |
|
I was thinking about At first step I do not want implement support for multiple modules & commands. I can be useful, but until somebody really needs it for me it seems to me L'art pour L'art work. (Also can be workarounded easily with chained commands.) |
i would say so i'd personnally push
yeah you got a point, never mind about that one 😉 something like this, right? 😏 def "multi-test" [] {
let tests = $in
let runner = (
git rev-parse --show-toplevel
| str trim
| path join "crates" "nu-utils" "standard_library" "tests.nu"
)
$tests
| transpose module command
| flatten
| each {|test|
nu $runner --module $test.module --command $test.command
}
}
{foo: [f1 f2 f3], bar: [b1 b4]} | multi-test |
|
That can be an example. The other one is just I added |
amtoine
left a comment
There was a problem hiding this comment.
thanks for the --list option and the extended documentation 👌
b6d0ede to
18404f7
Compare
|
Conflict with main branch is resolved. |
|
It seems that there is an unrelated fail in Ubuntu 20.04 checks. |
|
Master is merged to get rid of CI errors. |
|
Then let's give this a shot! Thanks! |
…d-throw-true-error This commit merges the PR that introduces the conflict into the current feature branch: nushell#8499 i've kept the four new options to the runner and made them work with the structured paradigm of the runner in nushell#8525.
I am implementing a nu plugin, and want to unit test that it works well.
Basic usage (unchanged)
Select the folder to run tests within (subfolders included)
Select module to run tests within
Select test command to run
Complex usage