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

+14 -10
View File
@@ -16,19 +16,23 @@ Canonical guidance for AI coding agents in this repo (no CLAUDE.md; this file is
## Commands
Enter the toolchain with `devenv shell` (Rust, pkg-config, libsystemd, otelcol). Without it you need a Rust toolchain, `pkg-config` and the libsystemd dev files.
Enter the toolchain with `devenv shell` (Rust, pkg-config, libsystemd, nushell, otelcol). Without it you need a Rust toolchain, `pkg-config` and the libsystemd dev files.
All checks go through one runner, `dev/test.nu`, exposed as the `test` script inside `devenv shell`. `test --help` lists the underlying cargo and nix commands.
```sh
cargo build --release # target/release/slinuxm
cargo test # unit + integration tests (fake sources)
cargo clippy --all-targets -- -D warnings # must be clean
cargo fmt --check
devenv shell -- smoke # real binary smoke test (cargo test --test binary_smoke)
cargo tree -i openssl # must print nothing
nix build && nix flake check # package, module, VM test (slow; Nix changes only)
devenv shell -- test lint # cargo fmt --check, clippy -D warnings, cargo tree -i openssl (empty)
devenv shell -- test unit # cargo test --lib --bins
devenv shell -- test integration [filter] [--nocapture] # cargo test --tests (plain, tls, integration, binary_smoke, peers)
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 # real binary smoke test (cargo test --test binary_smoke -- --nocapture)
cargo build --release # target/release/slinuxm
nix build && nix flake check # package, module, VM test (slow; Nix changes only)
```
`devenv up` runs a local OTLP collector (`dev/otelcol.yaml`). Do not run nix builds unless the task involves Nix files, and never while another agent is running the nix gate.
`devenv up` runs a local OTLP collector (`dev/otelcol.yaml`). Do not run nix builds unless the task involves Nix files, and never while another agent is running the nix gate. When editing `dev/test.nu`, run `nu dev/test.nu self-check`; it fails if the command table, the subcommands and the help text drift apart.
## Conventions
@@ -59,7 +63,7 @@ nix build && nix flake check # package, module, VM test (slow;
## Definition of done
1. `cargo clippy --all-targets -- -D warnings`, `cargo test` and `cargo fmt --check` pass.
1. `devenv shell -- test all` (fmt, clippy, unit and integration tests) passes; that is `cargo fmt --check`, `cargo clippy --all-targets -- -D warnings` and `cargo test`.
2. New behaviour has tests (fakes for handlers and tools; `tests/` for end to end).
3. Docs updated: `README.md`, `config.example.toml`, `ARCHITECTURE.md` as relevant.
4. `TODO.md` updated; any deferred work is in the Backlog with a reason.