From edeac90096371dad5dc9ecceec3d037733fedd10 Mon Sep 17 00:00:00 2001 From: Leo McArdle Date: Tue, 25 Jan 2022 16:23:31 +0000 Subject: [PATCH] update run-unit-tests.sh to work with unittest, ensure env vars are correct --- bin/run-unit-tests.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/run-unit-tests.sh b/bin/run-unit-tests.sh index 7a0b299c4..15020bc78 100755 --- a/bin/run-unit-tests.sh +++ b/bin/run-unit-tests.sh @@ -1,5 +1,13 @@ #!/bin/bash +# unset all environment variables which have been set in .env file +unset $(sed -n -e 's/^\s*\([^#][^=]*\)=.*/\1/p' .env) + +# set environment variables from .env-test file +set -o allexport +source .env-test +set +o allexport + set -ex # wait on database in DATABASE_URL to be ready @@ -10,4 +18,4 @@ urlwait http://elasticsearch7:9200 60 ./manage.py es7_init --migrate-writes --migrate-reads -./manage.py test --noinput --nologcapture -a '!search_tests' +./manage.py test --noinput