about summary refs log tree commit diff
path: root/Makefile
blob: 9dbac7eec93a2f127f4c7d08b3821024a9e1147a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# BNW test driver.
#
# The container tests build the BNW package from the git origin pinned
# in guix-bioinformatics/gn/packages/bnw.scm (fetched from
# git.genenetwork.org), so push your changes to gn-bnw main first, or
# update the pin, before running them.  Requires a checkout layout
# with guix-bioinformatics, gn-machines, run-guix-container and
# contrib/guix-forge/guix side by side (paths overridable in
# test/run_container_tests.sh) and the run-guix-system-container
# daemon on 127.0.0.1:8900.
#
#   make            run the container tests
#   make run        same, but leave the container running (web on :8881)
#   make clean      remove test artifacts and leaked test VMs

.PHONY: test run clean

test:
	@echo "== running the BNW container tests =="
	@./test/run_container_tests.sh

run:
	@./test/run_container_tests.sh --keep

clean:
	rm -rf test/__pycache__ test/logs
	rm -f /tmp/bnw-vm.qcow2 /tmp/bnw-vm*.log /tmp/bnw-container-test.log
	@-for p in $$(ls /proc 2>/dev/null | grep -E '^[0-9]+$$'); do \
	  case "$$(tr '\0' ' ' < /proc/$$p/cmdline 2>/dev/null)" in \
	    *qemu-system*bnw-vm.qcow2*) kill -9 $$p 2>/dev/null && echo "killed leaked test VM (pid $$p)";; \
	  esac; \
	done