summaryrefslogtreecommitdiff
path: root/test.sh
blob: e204f91b1083fe88c859ef1f45f4e6a28ddc5cd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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"