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

44 lines
1.5 KiB
Makefile

GIT_ROOT := $$(git rev-parse --show-toplevel)
test-integration:
@$(GIT_ROOT)/nix/test_integration.sh
test-integration-hosts:
$(GIT_ROOT)/scripts/tests/extra_hosts
CLIENT_VM := abra-client
vm-client-status:
sudo systemctl status microvm@$(CLIENT_VM).service
vm-client-create:test-integration-hosts
cd $(GIT_ROOT) && sudo microvm -f git+file://$(GIT_ROOT) -c $(CLIENT_VM)
vm-client-start:
sudo systemctl start microvm@$(CLIENT_VM).service
vm-client-update:test-integration-hosts
cd $(GIT_ROOT) && sudo microvm -R -f git+file://$(GIT_ROOT) -u $(CLIENT_VM)
vm-client-run:
sudo microvm -f git+file://$(GIT_ROOT) -r $(CLIENT_VM)
vm-client-stop:
sudo systemctl stop microvm@$(CLIENT_VM)
vm-client-delete: vm-client-stop
sudo rm -rf /var/lib/microvms/$(CLIENT_VM)
vm-client-connect:
ssh abra@10.0.0.2 -i $(GIT_ROOT)/tests/resources/local_integration_ssh
SERVER_VM := abra-server
vm-server-status:
sudo systemctl status microvm@$(SERVER_VM).service
vm-server-create:
cd $(GIT_ROOT) && sudo microvm -f git+file://$(GIT_ROOT) -c $(SERVER_VM)
vm-server-start:
sudo systemctl start microvm@$(SERVER_VM).service
vm-server-update:
cd $(GIT_ROOT) && sudo microvm -R -f git+file://$(GIT_ROOT) -u $(SERVER_VM)
vm-server-run:
cd $(GIT_ROOT) && sudo microvm -f git+file://$(GIT_ROOT) -r $(SERVER_VM)
vm-server-stop:
sudo systemctl stop microvm@$(SERVER_VM)
vm-server-delete: vm-server-stop
sudo rm -rf /var/lib/microvms/$(SERVER_VM)
vm-server-connect:
ssh abra@10.0.0.3 -i $(GIT_ROOT)/tests/resources/local_integration_ssh