forked from opendevstack/ods-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smoke-test.sh
executable file
·37 lines (30 loc) · 1.14 KB
/
smoke-test.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
#!/usr/bin/env bash
# set -x
set +e
set -o pipefail
export CGO_ENABLED=0
THIS_SCRIPT="$(basename ${0})"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ODS_CORE_DIR=${SCRIPT_DIR%/*}
ODS_NAMESPACE=$(${ODS_CORE_DIR}/scripts/get-config-param.sh ODS_NAMESPACE)
OPENSHIFT_APPS_BASEDOMAIN=$(${ODS_CORE_DIR}/scripts/get-config-param.sh OPENSHIFT_APPS_BASEDOMAIN)
export PROVISION_API_HOST=https://prov-app-${ODS_NAMESPACE}${OPENSHIFT_APPS_BASEDOMAIN}
echo "PROVISION_API_HOST = ${PROVISION_API_HOST}"
if ! oc whoami &> /dev/null; then
echo "${THIS_SCRIPT}: You need to login to OpenShift to run the tests"
exit 1
fi
if [ -f test-smoketest-results.txt ]; then
rm test-smoketest-results.txt
fi
sleep 5
echo " "
echo "${THIS_SCRIPT}: go test -v -count=1 -timeout 30h github.com/opendevstack/ods-core/tests/smoketest "
go test -v -count=1 -timeout 30h github.com/opendevstack/ods-core/tests/smoketest | tee test-smoketest-results.txt 2>&1
exit_code=$?
echo "${THIS_SCRIPT}: return value: ${exit_code}"
if [ -f test-smoketest-results.txt ]; then
set -e
go-junit-report < test-smoketest-results.txt > test-smoketest-report.xml
fi
exit $exit_code