summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-08 16:57:04 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-08 16:57:04 -0600
commitd284fe2d2518c43097c0fea436d2073de14f3ada (patch)
treef35fd1dd4810bed84d190706076d4b0939e1131c
parenta6269d1fe01b9b5f5438490d0dd6caf8d833c02a (diff)
Fix integration tests
-rw-r--r--test.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/test.sh b/test.sh
index e204f91..b45cd55 100644
--- a/test.sh
+++ b/test.sh
@@ -9,14 +9,20 @@ test_cfg="(import ./config.nix) // {
dataDir=\"${test_dir}/data\";
}"
-$(nix-build --no-out-link -A entrypoint \
+entrypoint=$(nix-build --no-out-link -A entrypoint \
--arg baseConfig "$test_cfg" \
- --arg baseSkipServices '["srv" "static"]') &
+ --arg skipServices '["srv"]')
+$entrypoint &
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.
+# NOTE this is a bit of a hack... the location of the redis socket's source of
+# truth is in default.nix, but it's not clear how to get that from there to
+# here, so we reproduce the calculation here.
+while [ ! -e $test_dir/run/redis ]; do
+ echo "waiting for redis unix socket"
+ sleep 1
+done
nix-shell -A srv.test \
--arg baseConfig "$test_cfg" \