Adds a pkgs.testers.nixosTest (checks.<system>.invoiceninja) that boots the module end-to-end and checks that mysql/redis/phpfpm/queue-worker/ nginx come up, the one-time migrate/seed/admin-create setup completed, the app shell and /login page are served, invoiceninja-manage works, and the seeded admin can log in via the API. Factors the shared services.invoiceninja config used by both the interactive VM and the new test into tests/common.nix, and satisfies NixOS's fileSystems/bootloader assertions in the interactive VM config so `nix flake check` evaluates nixosConfigurations.test cleanly (the qemu-vm module already overrides both when actually building config.system.build.vm, so this only affects the toplevel-eval path). Also adds a `just test` recipe, a CLAUDE.md codebase overview, and a .gitignore for the result/nixos.qcow2 build artifacts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
39 lines
837 B
Makefile
39 lines
837 B
Makefile
set quiet := true
|
|
|
|
# Passed to QEMU in boot-vm
|
|
export QEMU_KERNEL_PARAMS := "console=ttyS0"
|
|
export QEMU_NET_OPTS := "hostfwd=tcp::8080-:80"
|
|
export QEMU_OPTS := "-nographic"
|
|
|
|
[private]
|
|
_default:
|
|
just --list
|
|
|
|
[doc('Clean build artifacts and shutdown running virtual machines')]
|
|
[group('maintenance')]
|
|
clean:
|
|
#!/usr/bin/env bash
|
|
rm result > /dev/null 2>&1
|
|
rm nixos.qcow2 > /dev/null 2>&1
|
|
pkill qemu
|
|
exit 0
|
|
|
|
[doc('Build virtual machine for testing')]
|
|
[group('main')]
|
|
build-vm: clean
|
|
nom build ".#nixosConfigurations.test.config.system.build.vm"
|
|
|
|
[doc('Run virtual machine in current terminal')]
|
|
[group('main')]
|
|
boot-vm:
|
|
#!/usr/bin/env bash
|
|
[ -x result/bin/run-nixos-vm ] && \
|
|
./result/bin/run-nixos-vm
|
|
reset
|
|
|
|
[doc('Run the automated NixOS VM test')]
|
|
[group('main')]
|
|
test:
|
|
nix flake check -L
|
|
|