-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun-tests.sh
More file actions
executable file
·28 lines (24 loc) · 964 Bytes
/
run-tests.sh
File metadata and controls
executable file
·28 lines (24 loc) · 964 Bytes
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
#!/usr/bin/env bash
set -eu
remove_quotes () {
echo "$1" | tr -d '"'
}
declare error_code
# shellcheck disable=SC2154
#The CFN variables seem to include quotes when used in tests these must be removed before assigning them.
export API_TEST_SESSION_EVENTS_TABLE=$(remove_quotes $CFN_SessionEventsTable)
export GOV_NOTIFY_API=$(remove_quotes $CFN_GovNotifyAPIURL)
export DEV_IPR_TEST_HARNESS_URL=$(remove_quotes $CFN_IpvReturnTestHarnessURL)
export DEV_IPR_API_URL=$(remove_quotes $CFN_IpvApiURL)
export REDIRECT_URI=$(remove_quotes $CFN_IpvRedirectUrl)
export OIDC_IPR_API_URL=$(remove_quotes $CFN_oidcStubApiURL)
export CLIENT_ID=$(aws ssm get-parameter --name "/tests/$TEST_ENVIRONMENT/ipvreturn/CLIENT_ID" | jq -r ".Parameter.Value")
# disabling error_check to allow report generation for successful + failed tests
set +e
cd /src; npm run test:api
error_code=$?
cp -rf results $TEST_REPORT_ABSOLUTE_DIR
if [ $error_code -ne 0 ]
then
exit $error_code
fi