diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2022-05-08 16:36:28 -0600 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2022-05-08 16:36:28 -0600 |
commit | a759fc28f715f4c7523a830314e3ccf09e2f0d70 (patch) | |
tree | 7138b26009f4a4dd1ba0ae7d4af1962ee70992fa /test.sh | |
parent | ddb126db1709b1c7679b8370b508639991387bf0 (diff) |
Add test target to Makefile to run full integration tests
Diffstat (limited to 'test.sh')
-rw-r--r-- | test.sh | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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" |