T: rename runner to dev-test

This commit is contained in:
ari committed 2026-10-19 22:37:08 -04:00
1 parent 6dade6239d
commit b476ac2b0c
6 files changed
+331 -219

No files matched your search

+10 -10
View File
@@ -178,16 +178,16 @@ ldd /usr/local/bin/slinuxm # libc, libm, libgcc_s, libsystemd and its depende
## Testing
Checks run through one runner, `dev/test.nu`. `devenv shell -- test …` runs it from any shell. In an interactive bash or zsh, `test` is the shell builtin, so `test unit` exits 0 without running the suite. `devenv shell -- test --help` lists every subcommand and the cargo or nix command behind it.
Checks run through one runner, `dev/dev-test.nu`. `devenv shell -- dev-test …` runs it from any shell, including an interactive one. `devenv shell -- dev-test --help` lists every subcommand and the cargo or nix command behind it.
```sh
devenv shell -- test unit # cargo test --lib --bins
devenv shell -- test integration [filter] [--nocapture] # cargo test --test '*' (integration targets only)
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
devenv shell -- dev-test unit # cargo test --lib --bins
devenv shell -- dev-test integration [filter] [--nocapture] # cargo test --test '*' (integration targets only)
devenv shell -- dev-test lint # cargo fmt --check, clippy -D warnings, no openssl
devenv shell -- dev-test vm [vm|peers] # NixOS VM test (slow, needs /dev/kvm)
devenv shell -- dev-test all # lint, unit, integration; stops at the first failure
devenv shell -- dev-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.
@@ -195,7 +195,7 @@ The smoke test runs the real built `slinuxm` binary against a throwaway SQLite d
## Development
```sh
devenv shell -- test all # fmt, clippy, unit and integration tests
devenv shell -- dev-test all # fmt, clippy, unit and integration tests
```
`devenv shell -- test --help` shows the underlying commands (`cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`, `cargo test --lib --bins`, `cargo test --test '*'`). Nushell: `use dev/test.nu *` gives `test unit`, `test vm peers`, ... with tab completion. zsh users add `source <(nu dev/test.nu completions zsh)` to `.zshrc` after `compinit`. An interactive `devenv shell` installs the bash function; `test -f` stays the builtin. 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).
`devenv shell -- dev-test --help` shows the underlying commands (`cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`, `cargo test --lib --bins`, `cargo test --test '*'`). Nushell: `use dev/dev-test.nu *` gives `dev-test unit`, `dev-test vm peers`, ... with tab completion. zsh users add `source <(nu dev/dev-test.nu completions zsh)` to `.zshrc` after `compinit`. An interactive `devenv shell` installs bash completion. 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).