Skip to content

Commit 0cbf6f8

Browse files
authored
Fix integ tests with binary we build (#2)
Co-authored-by: Jacob Fuss <[email protected]>
1 parent ce45546 commit 0cbf6f8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ compile-lambda-linux:
1313
tests:
1414
go test ./...
1515

16-
integ-tests-and-compile: compile-lambda-linux
16+
integ-tests-and-compile: tests compile-lambda-linux
1717
python3 -m venv .venv
1818
.venv/bin/pip install --upgrade pip
1919
.venv/bin/pip install requests
2020
.venv/bin/python3 test/integration/local_lambda/end-to-end-test.py
2121

22-
integ-tests-with-docker: compile-with-docker
22+
integ-tests-with-docker: tests compile-with-docker
2323
python3 -m venv .venv
2424
.venv/bin/pip install --upgrade pip
2525
.venv/bin/pip install requests

test/integration/local_lambda/end-to-end-test.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def tearDownClass(cls):
3333

3434

3535
def test_env_var_with_eqaul_sign(self):
36-
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"
36+
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"
3737

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

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

4646
def test_two_invokes(self):
47-
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"
47+
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"
4848

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

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

6161

6262
def test_timeout_invoke(self):
63-
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"
63+
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"
6464

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

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

7373
def test_exception_returned(self):
74-
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"
74+
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"
7575

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

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

107107
def test_invoke_with_pre_runtime_api_runtime(self):
108-
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"
108+
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"
109109

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

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

118118
def test_function_name_is_overriden(self):
119-
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"
119+
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"
120120

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

0 commit comments

Comments
 (0)