T: review round 1 fix runner argv, filter cache, and the test builtin
This commit is contained in:
1 parent
40cf1073f4
commit
6dade6239d
6 files changed
+562
-93
No files matched your search
+11
-5
@@ -6,18 +6,24 @@ The peers acceptance test is a NixOS VM test. Three machines run the real `slinu
|
||||
devenv shell -- test vm peers # nix build .#tests.x86_64-linux.peers -L
|
||||
```
|
||||
|
||||
Against a tree without the consolidator the test stops at the first peers assertion; that is expected, the test is written ahead of the feature. `dev/test.nu` is the repository's test runner; `test --help` lists its subcommands and the command behind each.
|
||||
Against a tree without the consolidator the test stops at the first peers assertion; that is expected, the test is written ahead of the feature. `dev/test.nu` is the repository's test runner. `devenv shell -- test --help` lists its subcommands and the command behind each. Inside an interactive bash or zsh, `test` is the shell builtin, so `test vm` exits 0 without running anything. Use `devenv shell -- test …` or `nu dev/test.nu …`.
|
||||
|
||||
In Nushell the runner is a module. Load it once, for example in `config.nu`, and `test unit`, `test vm peers`, ... complete natively:
|
||||
In Nushell the runner is a module. Load it once, for example in `config.nu`, and `test unit`, `test vm peers`, ... complete natively. Integration-test name completion is cached in `target/skyg-test-filters.cache`, keyed on the newest mtime of the Rust sources and the Cargo manifests.
|
||||
|
||||
```nu
|
||||
use /home/you/src/skyg-linux-tracker/dev/test.nu * # absolute path to dev/test.nu
|
||||
```
|
||||
|
||||
zsh and bash get completion from the same command table; inside `devenv shell` this is already sourced for you:
|
||||
zsh and bash completion comes from the same command table. The generated script defines a `test` function for known subcommands (`test unit`, `test vm peers`, ...) and leaves other invocations (`test -f`) to the builtin. An interactive `devenv shell` sources the bash script and prints a one-line note on stderr. That hook runs in bash, so it cannot install zsh functions, and direnv will not carry them either. zsh users add the following to `.zshrc` after `compinit`:
|
||||
|
||||
```sh
|
||||
source <(test completions zsh) # or: source <(test completions bash)
|
||||
source <(nu /home/you/src/skyg-linux-tracker/dev/test.nu completions zsh)
|
||||
```
|
||||
|
||||
`test self-check` fails if the command table, the defined subcommands and the help text drift apart.
|
||||
bash, from the repo checkout:
|
||||
|
||||
```sh
|
||||
source <(nu dev/test.nu completions bash)
|
||||
```
|
||||
|
||||
`nu dev/test.nu self-check` fails if the command table, the defined subcommands, the help text, the cargo argv, the filter cache or the shell wrapper drift apart.
|
||||
Reference in new issue
Block a user