Files
devydaveanddevydave 550c9aa48f
continuous-integration/drone/push Build is passing
test: introduce local integration testing (#902)
This PR adds a declarative integration testing setup which includes 2 local VMs client and server which can be started and stopped via a command. The VMs are run with QEMU and created by https://github.com/microvm-nix/microvm.nix
The key pair is generated for this use case and is safe to commit, it resolves the problem that the readFile function can only be used with git tracked files.

---------

Co-authored-by: devydave <yannick-dev@tutanota.com>
Reviewed-on: #902
Reviewed-by: p4u1 <133+p4u1@noreply.git.coopcloud.tech>
Co-authored-by: devydave <bittedanke@tutanota.com>
2026-10-31 08:28:04 +00:00
..

Hosts

These hosts are VMs used for running the integration tests on your local machine. The hosts contain a client where abra with the tests will be run and a server to simulate a remote machine.

Prepare the host

For this setup to work you need a machine with NixOS and flakes enabled.

  1. Import the abra flake

The install example is based on the using nix flakes wiki page.

inputs = {
  abra = {
    url = "git+https://git.coopcloud.tech/toolshed/abra.git";
  };
};
  1. Add the host module to your configuration

Now add the host module to your configuration. At the toplevel of a flake it could look like this:

desktop = inputs.nixpkgs.lib.nixosSystem {
  system = "x86_64-linux";
  modules = [
    abra.nixosModules.host
    ./configuration.nix
  ];
  specialArgs = inputs;
};
  1. Adjust the required config
abra.testing = {
  enable = true; # loads the required config, when set true
  externalInterface = "eth1"; # adjust this to your network interface that has access to the internet
};

You can look up the interface with ip link. After that rebuild your system and you are ready to go.

Get started

After preparing the host run:

make test-integration

This runs the automatic setup of the VMs and network. You will be prompted if you want to run all or specific files.