NixOS tests are pretty cool!
I've been fixing an issue where, if you do a deployment to a remote machine (with 'nixos-rebuild switch --target-host=foo'), and the connection would get broken off during the 'switch', the switch would be aborted - worst-case leading to that connection not getting restored.
I initially tested this manually, with the Raspberry Pi I encountered this problem with, which was elaborate and painful (especially when I got something wrong and the connection was lost). What's more, this would be useless to someone reviewing my code, as they don't have my pi sitting on their desk.
I now recreated the situation in a NixOS test, which spins up 2 VM's and exercises them with some Python code. Very smooth, and there's also an 'interactive' mode where you get access to the Python REPL and the consoles of the QEMU VM's for manual inspection and manipulation.
https://github.com/NixOS/nixpkgs/pull/463029
Also at https://arnout.engelen.eu/blog/nixos-tests/
#NixOS #RaspberryPi