From a759fc28f715f4c7523a830314e3ccf09e2f0d70 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sun, 8 May 2022 16:36:28 -0600 Subject: Add test target to Makefile to run full integration tests --- test.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test.sh (limited to 'test.sh') diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..e204f91 --- /dev/null +++ b/test.sh @@ -0,0 +1,23 @@ + +test_dir="$(mktemp -d)" + +mkdir -p "$test_dir"/run +mkdir -p "$test_dir"/data + +test_cfg="(import ./config.nix) // { + runDir=\"${test_dir}/run\"; + dataDir=\"${test_dir}/data\"; +}" + +$(nix-build --no-out-link -A entrypoint \ + --arg baseConfig "$test_cfg" \ + --arg baseSkipServices '["srv" "static"]') & + +trap "kill $!; wait; rm -rf $test_dir" EXIT + +# TODO there's a race condition here, we should wait until redis is definitely +# listening before commencing the tests. + +nix-shell -A srv.test \ + --arg baseConfig "$test_cfg" \ + --run "cd srv/src && go test ./... -count=1 -tags integration" -- cgit v1.2.3