Skip to content

Commit 43a616a

Browse files
committed
Support testing of the local docker image
1 parent 825359c commit 43a616a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# https://github.com/lambci/docker-lambda#documentation
22
FROM lambci/lambda:build-provided
3-
ARG RUST_VERSION
3+
ARG RUST_VERSION=stable
44
RUN yum install -y jq
55
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
66
| sh -s -- -y --profile minimal --default-toolchain $RUST_VERSION
77
ADD build.sh /usr/local/bin/
88
VOLUME ["/code"]
99
WORKDIR /code
10-
ENTRYPOINT ["/usr/local/bin/build.sh"]
10+
ENTRYPOINT ["/usr/local/bin/build.sh"]

tests/test.sh

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

89
source "${HERE}"/bashtest.sh
910

@@ -15,7 +16,7 @@ package_bin() {
1516
-v "${PWD}":/code \
1617
-v "${HOME}"/.cargo/registry:/root/.cargo/registry \
1718
-v "${HOME}"/.cargo/git:/root/.cargo/git \
18-
softprops/lambda-rust && \
19+
${IMAGE} && \
1920
ls target/lambda/release/"$1".zip > /dev/null 2>&1
2021
}
2122

@@ -26,7 +27,7 @@ package_all() {
2627
-v "${PWD}":/code \
2728
-v "${HOME}"/.cargo/registry:/root/.cargo/registry \
2829
-v "${HOME}"/.cargo/git:/root/.cargo/git \
29-
softprops/lambda-rust && \
30+
${IMAGE} && \
3031
ls target/lambda/release/"${1}".zip > /dev/null 2>&1
3132
}
3233

@@ -38,13 +39,13 @@ package_all_dev_profile() {
3839
-v "${PWD}":/code \
3940
-v "${HOME}"/.cargo/registry:/root/.cargo/registry \
4041
-v "${HOME}"/.cargo/git:/root/.cargo/git \
41-
softprops/lambda-rust && \
42+
${IMAGE} && \
4243
ls target/lambda/debug/"${1}".zip > /dev/null 2>&1
4344
}
4445

4546
for project in test-func test-multi-func test-func-with-hooks; do
4647
cd "${HERE}"/"${project}"
47-
echo "👩‍🔬 Running tests for $project"
48+
echo "👩‍🔬 Running tests for $project with image $IMAGE"
4849

4950
if [[ "$project" == test-multi-func ]]; then
5051
bin_name=test-func
@@ -75,4 +76,4 @@ for project in test-func test-multi-func test-func-with-hooks; do
7576
assert "when invoked, it produces expected output" diff expected-output.json test-out.log
7677
done
7778

78-
end_tests
79+
end_tests

0 commit comments

Comments
 (0)