T: T7 nushell test runner, devenv test script, command lists, docs testing section

This commit is contained in:
ari committed 2026-10-19 22:37:08 -04:00
1 parent 396c382046
commit 40cf1073f4
6 files changed
+452 -17

No files matched your search

+11 -5
View File
@@ -178,8 +178,16 @@ ldd /usr/local/bin/slinuxm # libc, libm, libgcc_s, libsystemd and its depende
## Testing
Checks run through one runner, `dev/test.nu`, which is also the `test` script inside `devenv shell`. `test --help` lists every subcommand and the cargo or nix command behind it.
```sh
devenv shell -- smoke # same as: cargo test --test binary_smoke -- --nocapture
devenv shell -- test unit # cargo test --lib --bins
devenv shell -- test integration [filter] [--nocapture] # cargo test --tests
devenv shell -- test lint # cargo fmt --check, clippy -D warnings, no openssl
devenv shell -- test vm [vm|peers] # NixOS VM test (slow, needs /dev/kvm)
devenv shell -- test all # lint, unit, integration; stops at the first failure
devenv shell -- test ci # all plus the vm test
devenv shell -- smoke # same as: cargo test --test binary_smoke -- --nocapture
```
The smoke test runs the real built `slinuxm` binary against a throwaway SQLite database in a temp directory: it creates a token with the CLI, starts `serve` on a free loopback port, exercises `/healthz`, REST and MCP with and without the token, revokes the token, and checks a clean SIGTERM exit and a 0600 database. It needs no root and no network. Checks that depend on host data (systemd over D-Bus, the journal) are skipped with a printed reason when the source is unavailable; Docker is never required.
@@ -187,9 +195,7 @@ The smoke test runs the real built `slinuxm` binary against a throwaway SQLite d
## Development
```sh
cargo test
cargo clippy --all-targets -- -D warnings
cargo fmt --check
devenv shell -- test all # fmt, clippy, unit and integration tests
```
The integration tests in `tests/` start the real router on an ephemeral port with fake sources. Design notes live in [ARCHITECTURE.md](ARCHITECTURE.md); work tracking in [TODO.md](TODO.md); extended docs in [docs/](docs/README.md).
`test --help` shows the underlying commands (`cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`, `cargo test`). In Nushell, `use dev/test.nu *` gives `test unit`, `test vm peers`, ... with tab completion; in zsh or bash, `source <(test completions zsh)` (or `bash`). The integration tests in `tests/` start the real router on an ephemeral port with fake sources. Design notes live in [ARCHITECTURE.md](ARCHITECTURE.md); work tracking in [TODO.md](TODO.md); extended docs in [docs/](docs/README.md).