-
Notifications
You must be signed in to change notification settings - Fork 3
/
launchReadyAPITestRunner.sh
executable file
·37 lines (32 loc) · 1.3 KB
/
launchReadyAPITestRunner.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
#!/bin/bash
## ACC
# ENDPOINT=https://sbdevrel-fua-smartbearcoin-acc.azurewebsites.net/api/payees
## PROD
# ENDPOINT=https://sbdevrel-fua-smartbearcoin-prd.azurewebsites.net/api/payees
ENDPOINT=${ENDPOINT:-'http://localhost:7071/api'}
PROJECT_FOLDER=${PROJECT_FOLDER:-'ReadyAPI_Tests'}
PROJECT_FILE=${PROJECT_FILE:-'SmartBearCoin-Payee-Provider-readyapi-project.xml'}
MISSING=()
[ ! "$PROJECT_FOLDER" ] && MISSING+=("PROJECT_FOLDER")
[ ! "$PROJECT_FILE" ] && MISSING+=("PROJECT_FILE")
[ ! "$ENDPOINT" ] && MISSING+=("ENDPOINT")
[ ! "$SLM_API_KEY" ] && MISSING+=("SLM_API_KEY")
case $(uname -sm) in
'Darwin x86' | 'Darwin x86_64' | 'Darwin arm64' | 'Windows')
ENDPOINT=${ENDPOINT/localhost/host.docker.internal}
;;
esac
if [ ${#MISSING[@]} -gt 0 ]; then
echo "ERROR: The following environment variables are not set:"
printf '\t%s\n' "${MISSING[@]}"
exit 1
fi
echo "executing tests for ${PROJECT_FILE}"
docker run --rm --network="host" \
-v=${PWD}/${PROJECT_FOLDER}:/project \
-e SLM_LICENSE_SERVER="https://api.slm.manage.smartbear.com:443" \
-e API_KEY=${SLM_API_KEY} \
-e ENDPOINT=${ENDPOINT} \
-e PROJECT_FILE=${PROJECT_FILE} \
-e COMMAND_LINE="'-e${ENDPOINT}' '-f/project' '-RJUnit-Style HTML Report' /project/${PROJECT_FILE}" \
smartbear/ready-api-soapui-testrunner:latest