Skip to content
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

fix: set LD_LIBRARY_PATH when running sam init/sam build tests for nodejs20 #112

Merged
merged 11 commits into from
Nov 15, 2023
2 changes: 1 addition & 1 deletion build-image-src/Dockerfile-nodejs20x
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ COPY ATTRIBUTION.txt /

# Compatible with initial base image
ENTRYPOINT []
CMD ["/bin/bash"]
CMD ["/bin/bash"]
28 changes: 20 additions & 8 deletions tests/build_image_base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,26 @@ def test_sam_init(self):
if self.dep_manager:
sam_init += f" --dependency-manager {self.dep_manager}"

op = self.client.containers.run(
image=self.image,
command=[
"/bin/sh",
"-c",
sam_init + " && cd sam-app && sam build",
],
).decode()
# For nodejs20.x set LD_LIBRARY_PATH env variable to execute sam commands
if self.runtime == 'nodejs20.x':
op = self.client.containers.run(
image=self.image,
command=[
"/bin/sh",
"-c",
sam_init + " && cd sam-app && sam build",
],
environment=["LD_LIBRARY_PATH="]
).decode()
else:
op = self.client.containers.run(
image=self.image,
command=[
"/bin/sh",
"-c",
sam_init + " && cd sam-app && sam build",
],
).decode()
self.assertTrue(op.find("Build Succeeded"))

def test_external_apps(self):
Expand Down
Loading