Parameterizes tests/common.nix and tests/default.nix on proxyServer (default "nginx"), giving flake.nix two nixosConfigurations (test-nginx/test-caddy) and `just build-vm [proxy]` a way to pick between them for interactive testing. The automated nixosTest now boots one node per proxy backend and runs the full assertion suite (factored into check_invoiceninja()) against each, so a regression in either nginx or caddy's config gets caught. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
39 lines
885 B
Makefile
39 lines
885 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 (proxy: nginx or caddy)')]
|
|
[group('main')]
|
|
build-vm proxy="nginx": clean
|
|
nom build ".#nixosConfigurations.test-{{proxy}}.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
|
|
|