forked from hasura/graphql-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprobe-pg-compatibility.sh
executable file
·47 lines (32 loc) · 1.01 KB
/
probe-pg-compatibility.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
set -e
usage="$0 postgresql://... "
if [ "$#" != 1 ];
then
echo "$usage"
exit 1
fi
pg_uri="$1"
shift
echo "Checking if 'docker compose' is free to use .."
running_containers=$(docker compose ls | wc -l)
if [ "$running_containers" -gt 1 ];
then
echo "docker appears to be running."
echo "Please finish what you're using docker for and run 'docker compose down' manually"
echo "before proceeding."
exit 1
fi
echo "Building test runner and report generator .."
cabal build api-tests
api_tests=$(cabal list-bin api-tests:exe:api-tests)
reporter=$(cabal list-bin api-tests:exe:render-feature-matrix)
rm tests-hspec.log || true
echo "Starting metadata db container .."
docker compose down -v && docker compose up postgres --wait
echo "Running integration test suite against '$pg_uri' .."
POSTGRES_VARIANT_URI="$pg_uri" $api_tests || true
echo "Tearing down metadata db container .."
docker compose down
echo "Generating feature matrix report: 'report.html' .."
$reporter < tests-hspec.log > report.html