-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtest-suite.sh
More file actions
executable file
·49 lines (44 loc) · 1.49 KB
/
test-suite.sh
File metadata and controls
executable file
·49 lines (44 loc) · 1.49 KB
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
46
47
48
49
#!/usr/bin/env bash
ORIG_DIR="$(pwd)"
cd "$(dirname "$0")"
BIN_DIR="$(pwd)"
function onExit() {
cd "${ORIG_DIR}"
}
trap "onExit" EXIT
#-------------------------------------------------------------------------------
# Check docker command is available
#-------------------------------------------------------------------------------
if ! hash docker 2>/dev/null; then
echo "ERROR - docker is required" 1>&2
exit 1
fi
#-------------------------------------------------------------------------------
# Generate the pytest env
#-------------------------------------------------------------------------------
source ~/.eoepca/state
cat <<EOF > ~/.eoepca/pytest.env
DOMAIN=${INGRESS_HOST}
SCHEME=${HTTP_SCHEME}
KEYCLOAK=${KEYCLOAK_HOST}
EOAPI=eoapi.${INGRESS_HOST}
MLOPS=sharinghub.${INGRESS_HOST}
REALM=${REALM}
TEST_USER=${KEYCLOAK_TEST_USER}
TEST_PASSWORD=${KEYCLOAK_TEST_PASSWORD}
ADMIN_CLIENT_ID=admin-cli
OAPIP_CLIENT_ID=${OAPIP_CLIENT_ID}
OAPIP_CLIENT_SECRET=${OAPIP_CLIENT_SECRET}
EOF
#-------------------------------------------------------------------------------
# Run the test suite via docker
#-------------------------------------------------------------------------------
PYTEST_OPTIONS="${@}"
mkdir -p ${ORIG_DIR}/.pytest_cache
docker run --rm -t -u $UID:$GID \
-e target=eoepca \
-v ~/.eoepca/pytest.env:/work/test/.env.eoepca \
-v ${ORIG_DIR}/.pytest_cache:/work/.pytest_cache \
-v ${ORIG_DIR}:/work/out \
eoepca/system-test \
pytest test ${PYTEST_OPTIONS} -v --junit-xml=out/test-report.xml