testing
This commit is contained in:
1 parent
d47c401013
commit
49c6d6e6cc
7 files changed
+187
-17
No files matched your search
@@ -836,9 +836,45 @@ The devshell provides nushell, nufmt, and pre-commit hooks. Enter it once:
|
||||
direnv allow
|
||||
```
|
||||
|
||||
On first entry devenv installs the pre-commit hooks automatically. Two hooks
|
||||
run on every commit:
|
||||
On first entry devenv installs the pre-commit hooks automatically. Hooks run
|
||||
on every commit, including:
|
||||
|
||||
- **nufmt** — formats all `*.nu` files in place
|
||||
- **gen-completions** — reruns `nu/gen-completions.nu` and stages
|
||||
`nu/completions.nu` whenever a usage block in the source files changes
|
||||
- **nu-tests** — runs the CLI test suite (see below) whenever anything
|
||||
under `nu/` changes
|
||||
|
||||
### Testing
|
||||
|
||||
Two test suites. Neither is ever run for you by an agent working in this
|
||||
repo — they're for you (or CI) to run.
|
||||
|
||||
**CLI tests** (`nu/tests/`), via [nutest](https://github.com/vyadh/nutest):
|
||||
|
||||
```bash
|
||||
runtest # everything (bin/ is on PATH inside the devShell)
|
||||
runtest vm_test # just nu/tests/vm_test.nu
|
||||
runtest-debug vm_test # load vm_test.nu into an interactive nu session instead
|
||||
```
|
||||
|
||||
Covers the CLI's pure helper functions (path/env defaults, `shquote`,
|
||||
`normalize-size`, the `gen-completions.nu` parser) and a smoke test that the
|
||||
whole `hermenix`/`vm`/`ctl` subcommand tree parses and dispatches correctly
|
||||
— without ever invoking a subcommand's real body (no ssh, no disk writes,
|
||||
no `nix build`).
|
||||
|
||||
**Guest VM test** (`guest/vm-test.nix`): boots `guest/common.nix` — the same
|
||||
module set `hermes-guest-image` is built from — in an ephemeral, throwaway
|
||||
NixOS test VM. No real disk under `/var/lib/hermes-vm/**` is ever touched:
|
||||
|
||||
```bash
|
||||
nix build .#checks.x86_64-linux.guest-vm --impure -L
|
||||
```
|
||||
|
||||
Checks first-boot seeding (`~/.hermes`, `~/workspace`, the `/etc/nixos`
|
||||
symlink), that seeding is idempotent across a reboot (the whole point of
|
||||
the `.seeded` marker), the `hermes` user/sudo setup, and SSH. It
|
||||
deliberately does not cover the real `hermes-install` script (no internet
|
||||
route inside the test VM) or `modules/host.nix`'s own `hermes-vm` QEMU
|
||||
service — both stay manual, operator-run checks.
|
||||
Reference in new issue
Block a user