Skip to content

Commit 0b128ed

Browse files
committed
refactor: 🎨 lints and remove lambci from testing
- apply shellcheck lints to file - replace lambci with aws base image - build verify _packaged_application function in script - build a docker image using aws lambda provided:al2 as base - add program and input code as required - run container - send test event with curl - validate output
1 parent 4d3b58d commit 0b128ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Directory of the integration test
44
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
55
# Root directory of the repository
6-
DIST=$(cd "$HERE"/..; pwd)
6+
# DIST=$(cd "$HERE"/..; pwd)
77
: "${IMAGE:=rustserverless/lambda-rust}"
88

99
source "${HERE}"/bashtest.sh
@@ -68,15 +68,15 @@ package_all_dev_profile() {
6868
}
6969

7070
for project in test-func test-multi-func test-func-with-hooks; do
71-
cd "${HERE}"/"${project}"
71+
cd "${HERE}"/"${project}" || exit 2
7272
echo "👩‍🔬 Running tests for $project with image $IMAGE"
7373

7474
if [[ "$project" == test-multi-func ]]; then
7575
bin_name=test-func
7676
else
7777
bin_name=bootstrap
7878
fi
79-
79+
echo "Bin name: ${bin_name} i am in ${PWD}"
8080
# package tests
8181
assert "it packages single bins" package_bin "${bin_name}"
8282

@@ -97,7 +97,7 @@ for project in test-func test-multi-func test-func-with-hooks; do
9797
-i -e DOCKER_LAMBDA_USE_STDIN=1 \
9898
--rm \
9999
-v /tmp/lambda:/var/task \
100-
lambci/lambda:provided.al2 < test-event.json | grep -v RequestId | grep -v '^\W*$' > test-out.log
100+
public.ecr.aws/lambda/provided:al2 < test-event.json | grep -v RequestId | grep -v '^\W*$' > test-out.log
101101

102102
assert "when invoked, it produces expected output" diff expected-output.json test-out.log
103103
done

0 commit comments

Comments
 (0)