-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathintegration-test.sh
More file actions
executable file
·62 lines (48 loc) · 1.03 KB
/
integration-test.sh
File metadata and controls
executable file
·62 lines (48 loc) · 1.03 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
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
set -e
HELP='
usage: integration-test.sh [<flags>]
Runs integration tests that send realistic HTTP requests to API Gateway via
SAM local.
Flags:
--help Show help
--localstack Run Cloudwatch via localstack in docker and hook SDK
to send metrics to localstack endpoint.
Dependencies:
AWS Serverless Application Model (SAM)
Docker
Go (for building lambda function)
'
function help() {
echo "$HELP" >&2
exit 1
}
function missing() {
echo >&2 "Error: $1 must be installed. Aborting."
help
}
localstack=0
while :; do
case $1 in
-h|-\?|--help)
help
;;
-l|--local)
localstack=1
;;
--) # end of all options
shift
break
;;
-?*)
printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2
;;
*) # no more options so break loop
break
esac
shift
done
type sam >/dev/null 2>&1 || missing "sam cli"
echo 'Running sam local invoke against requests in test/*.json'
# TODO: report on test case failures
find 'test' -name '*.json' | xargs -n1 sam local invoke --event