feat: add instruction for claude hooks
This commit is contained in:
parent
507779e306
commit
def062a84c
4 changed files with 123 additions and 0 deletions
34
.claude/test-runner.md
Normal file
34
.claude/test-runner.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Test Runner Instructions
|
||||
|
||||
## Determine affected hosts
|
||||
|
||||
Run `git diff --name-only HEAD` (or `git diff --name-only` for unstaged changes) to find changed files.
|
||||
|
||||
### Scope rules
|
||||
|
||||
- If changes are **only** under `hosts/<name>/`, test only that specific host:
|
||||
```bash
|
||||
./scripts/test-configuration <name>
|
||||
```
|
||||
- If changes touch `utils/`, root-level `.nix` files, or any shared configuration, test **all** hosts:
|
||||
```bash
|
||||
for host in amzebs-01 dev fw mail nas nb web-arm; do
|
||||
./scripts/test-configuration "$host"
|
||||
done
|
||||
```
|
||||
|
||||
### Custom package changes
|
||||
|
||||
If any files under `utils/pkgs/<package-name>/` were modified, also build the package directly:
|
||||
|
||||
```bash
|
||||
nix-build -E 'with import <nixpkgs> { overlays = [ (import ./utils/overlays/packages.nix) ]; config.allowUnfree = true; }; <package-name>'
|
||||
```
|
||||
|
||||
This catches build failures that `test-configuration` (evaluation-only) would miss.
|
||||
|
||||
## Notes
|
||||
|
||||
- Each `test-configuration` run performs a `nix-instantiate` dry-build (evaluation only, no binary builds).
|
||||
- A non-zero exit code from any host means the test failed.
|
||||
- Hosts: `amzebs-01`, `dev`, `fw`, `mail`, `nas`, `nb`, `web-arm`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue