Skip to content

Fix integ tests with binary we build #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ compile-lambda-linux:
tests:
go test ./...

integ-tests-and-compile: compile-lambda-linux
integ-tests-and-compile: tests compile-lambda-linux
python3 -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install requests
.venv/bin/python3 test/integration/local_lambda/end-to-end-test.py

integ-tests-with-docker: compile-with-docker
integ-tests-with-docker: tests compile-with-docker
python3 -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install requests
Expand Down
12 changes: 6 additions & 6 deletions test/integration/local_lambda/end-to-end-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def tearDownClass(cls):


def test_env_var_with_eqaul_sign(self):
cmd = f"docker run --name envvarcheck -d -v {self.path_to_binary}:/local-lambda-runtime-server -p 9003:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-local {self.image_name} /bootstrap-with-handler main.check_env_var_handler"
cmd = f"docker run --name envvarcheck -d -v {self.path_to_binary}:/local-lambda-runtime-server -p 9003:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-rie {self.image_name} /bootstrap-with-handler main.check_env_var_handler"

Popen(cmd.split(' ')).communicate()

Expand All @@ -44,7 +44,7 @@ def test_env_var_with_eqaul_sign(self):
self.assertEqual(b'"4=4"', r.content)

def test_two_invokes(self):
cmd = f"docker run --name testing -d -v {self.path_to_binary}:/local-lambda-runtime-server -p 9000:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-local {self.image_name} /bootstrap-with-handler main.success_handler"
cmd = f"docker run --name testing -d -v {self.path_to_binary}:/local-lambda-runtime-server -p 9000:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-rie {self.image_name} /bootstrap-with-handler main.success_handler"

Popen(cmd.split(' ')).communicate()

Expand All @@ -60,7 +60,7 @@ def test_two_invokes(self):


def test_timeout_invoke(self):
cmd = f"docker run --name timeout -d --env AWS_LAMBDA_FUNCTION_TIMEOUT=1 -v {self.path_to_binary}:/local-lambda-runtime-server -p 9001:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-local {self.image_name} /bootstrap-with-handler main.sleep_handler"
cmd = f"docker run --name timeout -d --env AWS_LAMBDA_FUNCTION_TIMEOUT=1 -v {self.path_to_binary}:/local-lambda-runtime-server -p 9001:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-rie {self.image_name} /bootstrap-with-handler main.sleep_handler"

Popen(cmd.split(' ')).communicate()

Expand All @@ -71,7 +71,7 @@ def test_timeout_invoke(self):
self.assertEqual(b"Task timed out after 1.00 seconds", r.content)

def test_exception_returned(self):
cmd = f"docker run --name exception -d -v {self.path_to_binary}:/local-lambda-runtime-server -p 9002:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-local {self.image_name} /bootstrap-with-handler main.exception_handler"
cmd = f"docker run --name exception -d -v {self.path_to_binary}:/local-lambda-runtime-server -p 9002:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-rie {self.image_name} /bootstrap-with-handler main.exception_handler"

Popen(cmd.split(' ')).communicate()

Expand Down Expand Up @@ -105,7 +105,7 @@ def tearDownClass(cls):
Popen(f"docker rmi {cls.image_name}".split(' ')).communicate()

def test_invoke_with_pre_runtime_api_runtime(self):
cmd = f"docker run --name testing -d -v {self.path_to_binary}:/local-lambda-runtime-server -p 9000:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-local {self.image_name} /bootstrap-with-handler main.success_handler"
cmd = f"docker run --name testing -d -v {self.path_to_binary}:/local-lambda-runtime-server -p 9000:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-rie {self.image_name} /bootstrap-with-handler main.success_handler"

Popen(cmd.split(' ')).communicate()

Expand All @@ -116,7 +116,7 @@ def test_invoke_with_pre_runtime_api_runtime(self):
self.assertEqual(b'"My lambda ran succesfully"', r.content)

def test_function_name_is_overriden(self):
cmd = f"docker run --name assert-overwritten -d --env AWS_LAMBDA_FUNCTION_NAME=MyCoolName -v {self.path_to_binary}:/local-lambda-runtime-server -p 9009:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-local {self.image_name} /bootstrap-with-handler main.assert_env_var_is_overwritten"
cmd = f"docker run --name assert-overwritten -d --env AWS_LAMBDA_FUNCTION_NAME=MyCoolName -v {self.path_to_binary}:/local-lambda-runtime-server -p 9009:8080 --entrypoint /local-lambda-runtime-server/aws-lambda-rie {self.image_name} /bootstrap-with-handler main.assert_env_var_is_overwritten"

Popen(cmd.split(' ')).communicate()

Expand Down