Skip to content

Commit 6e0c33e

Browse files
committed
fix nit, naming
1 parent d78aea8 commit 6e0c33e

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

.github/workflows/integ-tests.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ jobs:
99
go-tests:
1010
runs-on: ubuntu-latest
1111
environment:
12-
name: prod
12+
name: integ-tests
1313
steps:
1414
- uses: actions/checkout@v4
1515
- name: run go tests
1616
run: make tests-with-docker
1717
integ-tests-x86:
1818
runs-on: ubuntu-latest
1919
environment:
20-
name: prod
20+
name: integ-tests
2121
steps:
2222
- uses: actions/checkout@v4
2323
- uses: actions/setup-python@v5
@@ -28,7 +28,7 @@ jobs:
2828
integ-tests-arm64:
2929
runs-on: ubuntu-latest
3030
environment:
31-
name: prod
31+
name: integ-tests
3232
steps:
3333
- uses: actions/checkout@v4
3434
- uses: actions/setup-python@v5
@@ -39,7 +39,7 @@ jobs:
3939
integ-tests-old:
4040
runs-on: ubuntu-latest
4141
environment:
42-
name: prod
42+
name: integ-tests
4343
steps:
4444
- uses: actions/checkout@v4
4545
- uses: actions/setup-python@v5

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ prep-python:
4646
.venv/bin/pip install requests parameterized
4747

4848
exec-python-e2e-test:
49-
TEST_ARCH=${TEST_ARCH} TEST_PORT=${TEST_PORT} .venv/bin/python3 test/integration/local_lambda/test_end_to_end.py
49+
.venv/bin/python3 test/integration/local_lambda/test_end_to_end.py
5050

5151
integ-tests:
5252
make prep-python

test/integration/local_lambda/test_end_to_end.py

+26-26
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def test_env_var_with_equal_sign(self):
9999
def test_two_invokes(self):
100100
image, rie, image_name = self.tagged_name("twoinvokes")
101101

102-
cmd = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.success_handler"
102+
params = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.success_handler"
103103

104-
with self.create_container(cmd, image):
104+
with self.create_container(params, image):
105105
r = self.invoke_function()
106106

107107
self.assertEqual(b'"My lambda ran succesfully"', r.content)
@@ -115,9 +115,9 @@ def test_two_invokes(self):
115115
def test_lambda_function_arn_exists(self):
116116
image, rie, image_name = self.tagged_name("arnexists")
117117

118-
cmd = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.assert_lambda_arn_in_context"
118+
params = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.assert_lambda_arn_in_context"
119119

120-
with self.create_container(cmd, image):
120+
with self.create_container(params, image):
121121
r = self.invoke_function()
122122

123123
self.assertEqual(b'"My lambda ran succesfully"', r.content)
@@ -126,9 +126,9 @@ def test_lambda_function_arn_exists(self):
126126
def test_lambda_function_arn_exists_with_defining_custom_name(self):
127127
image, rie, image_name = self.tagged_name("customname")
128128

129-
cmd = f"--name {image} --env AWS_LAMBDA_FUNCTION_NAME=MyCoolName -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.assert_lambda_arn_in_context"
129+
params = f"--name {image} --env AWS_LAMBDA_FUNCTION_NAME=MyCoolName -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.assert_lambda_arn_in_context"
130130

131-
with self.create_container(cmd, image):
131+
with self.create_container(params, image):
132132
r = self.invoke_function()
133133

134134
self.assertEqual(b'"My lambda ran succesfully"', r.content)
@@ -137,9 +137,9 @@ def test_lambda_function_arn_exists_with_defining_custom_name(self):
137137
def test_timeout_invoke(self):
138138
image, rie, image_name = self.tagged_name("timeout")
139139

140-
cmd = f"--name {image} -d --env AWS_LAMBDA_FUNCTION_TIMEOUT=1 -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.sleep_handler"
140+
params = f"--name {image} -d --env AWS_LAMBDA_FUNCTION_TIMEOUT=1 -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.sleep_handler"
141141

142-
with self.create_container(cmd, image):
142+
with self.create_container(params, image):
143143
r = self.invoke_function()
144144

145145
self.assertEqual(b"Task timed out after 1.00 seconds", r.content)
@@ -148,25 +148,25 @@ def test_timeout_invoke(self):
148148
def test_exception_returned(self):
149149
image, rie, image_name = self.tagged_name("exception")
150150

151-
cmd = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.exception_handler"
151+
params = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.exception_handler"
152152

153-
with self.create_container(cmd, image):
153+
with self.create_container(params, image):
154154
r = self.invoke_function()
155155

156156
# Except the 3 fields assrted below, there's another field `request_id` included start from python3.12 runtime.
157-
# We should ignore asserting the field `request_id` for it is in a UUID like format and chages everytime
157+
# We should ignore asserting the field `request_id` for it is in a UUID like format and changes everytime
158158
result = r.json()
159-
self.assertEqual(result["errorMessage"],"Raising an exception")
160-
self.assertEqual(result["errorType"],"Exception")
161-
self.assertEqual(result["stackTrace"],[" File \"/var/task/main.py\", line 13, in exception_handler\n raise Exception(\"Raising an exception\")\n"])
159+
self.assertEqual(result["errorMessage"], "Raising an exception")
160+
self.assertEqual(result["errorType"], "Exception")
161+
self.assertEqual(result["stackTrace"], [" File \"/var/task/main.py\", line 13, in exception_handler\n raise Exception(\"Raising an exception\")\n"])
162162

163163

164164
def test_context_get_remaining_time_in_three_seconds(self):
165165
image, rie, image_name = self.tagged_name("remaining_time_in_three_seconds")
166166

167-
cmd = f"--name {image} -d --env AWS_LAMBDA_FUNCTION_TIMEOUT=3 -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.check_remaining_time_handler"
167+
params = f"--name {image} -d --env AWS_LAMBDA_FUNCTION_TIMEOUT=3 -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.check_remaining_time_handler"
168168

169-
with self.create_container(cmd, image):
169+
with self.create_container(params, image):
170170
r = self.invoke_function()
171171

172172
# Execution time is not decided, 1.0s ~ 3.0s is a good estimation
@@ -177,9 +177,9 @@ def test_context_get_remaining_time_in_three_seconds(self):
177177
def test_context_get_remaining_time_in_ten_seconds(self):
178178
image, rie, image_name = self.tagged_name("remaining_time_in_ten_seconds")
179179

180-
cmd = f"--name {image} -d --env AWS_LAMBDA_FUNCTION_TIMEOUT=10 -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.check_remaining_time_handler"
180+
params = f"--name {image} -d --env AWS_LAMBDA_FUNCTION_TIMEOUT=10 -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.check_remaining_time_handler"
181181

182-
with self.create_container(cmd, image):
182+
with self.create_container(params, image):
183183
r = self.invoke_function()
184184

185185
# Execution time is not decided, 8.0s ~ 10.0s is a good estimation
@@ -190,9 +190,9 @@ def test_context_get_remaining_time_in_ten_seconds(self):
190190
def test_context_get_remaining_time_in_default_deadline(self):
191191
image, rie, image_name = self.tagged_name("remaining_time_in_default_deadline")
192192

193-
cmd = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.check_remaining_time_handler"
193+
params = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.check_remaining_time_handler"
194194

195-
with self.create_container(cmd, image):
195+
with self.create_container(params, image):
196196
r = self.invoke_function()
197197

198198
# Executation time is not decided, 298.0s ~ 300.0s is a good estimation
@@ -203,9 +203,9 @@ def test_context_get_remaining_time_in_default_deadline(self):
203203
def test_invoke_with_pre_runtime_api_runtime(self):
204204
image, rie, image_name = self.tagged_name("pre-runtime-api")
205205

206-
cmd = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.success_handler"
206+
params = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.success_handler"
207207

208-
with self.create_container(cmd, image):
208+
with self.create_container(params, image):
209209
r = self.invoke_function()
210210

211211
self.assertEqual(b'"My lambda ran succesfully"', r.content)
@@ -214,9 +214,9 @@ def test_invoke_with_pre_runtime_api_runtime(self):
214214
def test_function_name_is_overriden(self):
215215
image, rie, image_name = self.tagged_name("assert-overwritten")
216216

217-
cmd = f"--name {image} -d --env AWS_LAMBDA_FUNCTION_NAME=MyCoolName -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.assert_env_var_is_overwritten"
217+
params = f"--name {image} -d --env AWS_LAMBDA_FUNCTION_NAME=MyCoolName -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8080 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.assert_env_var_is_overwritten"
218218

219-
with self.create_container(cmd, image):
219+
with self.create_container(params, image):
220220
r = self.invoke_function()
221221

222222
self.assertEqual(b'"My lambda ran succesfully"', r.content)
@@ -226,9 +226,9 @@ def test_port_override(self):
226226
image, rie, image_name = self.tagged_name("port_override")
227227

228228
# Use port 8081 inside the container instead of 8080
229-
cmd = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8081 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.success_handler --runtime-interface-emulator-address 0.0.0.0:8081"
229+
params = f"--name {image} -d -v {self.path_to_binary}:/local-lambda-runtime-server -p {self.PORT}:8081 --entrypoint /local-lambda-runtime-server/{rie} {image_name} {DEFAULT_1P_ENTRYPOINT} main.success_handler --runtime-interface-emulator-address 0.0.0.0:8081"
230230

231-
with self.create_container(cmd, image):
231+
with self.create_container(params, image):
232232
r = self.invoke_function()
233233

234234
self.assertEqual(b'"My lambda ran succesfully"', r.content)

0 commit comments

Comments
 (0)