AGENTS.md said the same command works in an interactive shell, which only holds inside devenv shell or direnv (the script is on PATH there). docs/consolidator.md now says the filter cache sits at the repo root and that a failing check raises a catchable error instead of closing the session.
30 lines
2.0 KiB
Markdown
30 lines
2.0 KiB
Markdown
## Testing
|
|
|
|
The peers acceptance test is a NixOS VM test. Three machines run the real `slinuxm`: `alpha` and `beta` consolidate each other over plain HTTP, and `alpha` also declares the TLS-only `gamma` with a private CA. It needs KVM and takes minutes.
|
|
|
|
```sh
|
|
devenv shell -- dev-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/dev-test.nu` is the repository's test runner. `devenv shell -- dev-test --help` lists its subcommands and the command behind each. In an interactive `devenv shell`, `dev-test …` is that same script.
|
|
|
|
In Nushell the runner is a module. Load it once, for example in `config.nu`, and `dev-test unit`, `dev-test vm peers`, ... complete natively. Integration-test name completion is cached in `target/skyg-test-filters.cache` at the repo root (not relative to the current directory, so completion works from any subdirectory), keyed on the newest mtime of the Rust sources and the Cargo manifests. A failing check raises a catchable error instead of exiting, so a red `dev-test unit` does not close the Nushell session that loaded the module; script mode still exits non-zero.
|
|
|
|
```nu
|
|
use /home/you/src/skyg-linux-tracker/dev/dev-test.nu * # absolute path to dev/dev-test.nu
|
|
```
|
|
|
|
zsh and bash completion comes from the same command table. The generated script only registers completion for the external command `dev-test`. An interactive `devenv shell` sources the bash script. That hook runs in bash and direnv will not source it either, so zsh users add the following to `.zshrc` after `compinit`:
|
|
|
|
```sh
|
|
source <(nu /home/you/src/skyg-linux-tracker/dev/dev-test.nu completions zsh)
|
|
```
|
|
|
|
bash, from the repo checkout:
|
|
|
|
```sh
|
|
source <(nu dev/dev-test.nu completions bash)
|
|
```
|
|
|
|
`nu dev/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 completion drift apart.
|