-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjar-tests.sh
More file actions
executable file
·33 lines (26 loc) · 1.11 KB
/
jar-tests.sh
File metadata and controls
executable file
·33 lines (26 loc) · 1.11 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
#!/usr/bin/env bash
my_dir="$(dirname "$(readlink -e "$0")")"
source "${my_dir}/common.sh"
source "${my_dir}/shared.envrc"
testThatLambdaCodeSizeDoesNotExceedMaxCodeSize() {
readonly local function_name="$(aws cloudformation describe-stack-resource \
--stack-name "${lambda_stack_name}" \
--logical-resource-id HelloWorldFunction \
--query StackResourceDetail.PhysicalResourceId \
--region "${region}" \
--output text)"
readonly local function_code_size="$(aws lambda get-function \
--function-name "${function_name}" \
--query Configuration.CodeSize)"
#Showcase start maxCodeSize
# 2020-06-26: actual_code_size_kb: 1293
readonly local max_code_size_kb=1400
#Showcase end maxCodeSize
readonly local actual_code_size_kb=$((function_code_size / 1024))
log "actual_code_size_kb: ${actual_code_size_kb}"
assertTrue \
"$(printf "lambda code size (%sKB) > max allowed code size (%sKB)" $actual_code_size_kb $max_code_size_kb)" \
"[ ${actual_code_size_kb} -le ${max_code_size_kb} ]"
}
# Load shUnit2.
. "${my_dir}/shunit2-2.1.8"