Skip to content

Commit 84fea2b

Browse files
committed
CI: fix test-prod
Populate the database before running the external curl tests.
1 parent 6125db8 commit 84fea2b

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/test-prod.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
export LOCAL_GID=$(id -g $USER)
6767
export $(grep -v '^#' .env_simple | xargs)
6868
docker compose -f docker-compose.yaml -f docker-compose.db.yaml -f docker-compose.prod.yaml up --quiet-pull -d --wait
69+
docker compose -f docker-compose.yaml -f docker-compose.db.yaml exec -T ows /bin/sh -c "cd /src && ./check-code-all.sh --no-test"
6970
7071
# Run some tests on the images
7172
# These tests require a working database

check-code-all.sh

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
#!/usr/bin/env bash
22
# Convenience script for running Travis-like checks.
3+
4+
while [[ $# -gt 0 ]]; do
5+
case $1 in
6+
--no-test)
7+
NO_TEST=1
8+
shift
9+
;;
10+
-*|--*)
11+
echo "Unknown option $1"
12+
exit 1
13+
;;
14+
esac
15+
done
16+
317
set -ex
418

519
# Initialise ODC schemas
@@ -150,7 +164,9 @@ datacube-ows-update
150164

151165
# Run tests, taking coverage.
152166
# Users can specify extra folders as arguments.
153-
python3 -m pytest --cov=datacube_ows --cov-report=xml integration_tests/
154-
cp /tmp/coverage.xml /mnt/artifacts
167+
if [ -z "$NO_TEST" ]; then
168+
python3 -m pytest --cov=datacube_ows --cov-report=xml integration_tests/
169+
cp /tmp/coverage.xml /mnt/artifacts, connect to pre-indexed database
170+
fi
155171

156172
set +x

0 commit comments

Comments
 (0)