From 6725775acf27cc3d09fc7dbd0a0fa2d9b5bdab4f Mon Sep 17 00:00:00 2001 From: Renato Valenzuela <37676028+valerena@users.noreply.github.com> Date: Thu, 6 Feb 2025 10:06:53 -0800 Subject: [PATCH 1/3] test: Set Python3.9 for AppVeyor tests (#7871) Previous jump from Python3.8 to 3.11 might have caused some issues --- appveyor-ubuntu.yml | 4 ++-- appveyor-windows-al2023.yml | 8 ++++---- appveyor-windows.yml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/appveyor-ubuntu.yml b/appveyor-ubuntu.yml index a9d183733d..a11ff21d72 100644 --- a/appveyor-ubuntu.yml +++ b/appveyor-ubuntu.yml @@ -16,8 +16,8 @@ configuration: - OtherAndEndToEndTesting environment: - PYTHON_HOME: "$HOME/venv3.11/bin" - PYTHON_VERSION: '3.11' + PYTHON_HOME: "$HOME/venv3.9/bin" + PYTHON_VERSION: '3.9' AWS_DEFAULT_REGION: us-east-1 SAM_CLI_DEV: 1 NODE_VERSION: "18.18.2" diff --git a/appveyor-windows-al2023.yml b/appveyor-windows-al2023.yml index bee6e0665d..1980827eb1 100644 --- a/appveyor-windows-al2023.yml +++ b/appveyor-windows-al2023.yml @@ -13,10 +13,10 @@ environment: TMPDIR: "%TEMP%" TMP: "%TEMP%" - # MSI Installers use Py3.11. It is sufficient to test with this version here. - PYTHON_HOME: "C:\\Python311-x64" - PYTHON_SCRIPTS: "C:\\Python311-x64\\Scripts" - PYTHON_EXE: "C:\\Python311-x64\\python.exe" + # MSI Installers use Py3.9. It is sufficient to test with this version here. + PYTHON_HOME: "C:\\Python39-x64" + PYTHON_SCRIPTS: "C:\\Python39-x64\\Scripts" + PYTHON_EXE: "C:\\Python39-x64\\python.exe" PYTHON_ARCH: "64" HOME: 'C:\Users\appveyor' HOMEDRIVE: "C:" diff --git a/appveyor-windows.yml b/appveyor-windows.yml index 69bdd052f3..024699854a 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -26,10 +26,10 @@ environment: TMPDIR: "%TEMP%" TMP: "%TEMP%" - # MSI Installers uses Py3.11. It is sufficient to test with this version here. - PYTHON_HOME: "C:\\Python311-x64" - PYTHON_SCRIPTS: "C:\\Python311-x64\\Scripts" - PYTHON_EXE: "C:\\Python311-x64\\python.exe" + # MSI Installers uses Py3.9. It is sufficient to test with this version here. + PYTHON_HOME: "C:\\Python39-x64" + PYTHON_SCRIPTS: "C:\\Python39-x64\\Scripts" + PYTHON_EXE: "C:\\Python39-x64\\python.exe" PYTHON_ARCH: "64" HOME: 'C:\Users\appveyor' HOMEDRIVE: "C:" From 359905b1cbab47eca7530d3346489d9b6919383f Mon Sep 17 00:00:00 2001 From: Renato Valenzuela <37676028+valerena@users.noreply.github.com> Date: Thu, 6 Feb 2025 14:16:11 -0800 Subject: [PATCH 2/3] test: remove double runtime in compatible layers (#7872) --- .../expected.template.yaml | 1 - .../expected.template.yaml | 1 - .../zip_based_lambda_functions_s3_backend/expected.template.yaml | 1 - .../expected.template.yaml | 1 - .../expected.template.yaml | 1 - .../cdk_v1_synthesized_template_level3_nested_zip_functions.json | 1 - ...1_synthesized_template_level3_nested_zip_functions_after.json | 1 - .../infra/cdk/cdk_v1_synthesized_template_zip_functions.json | 1 - .../cdk/cdk_v1_synthesized_template_zip_functions_after.json | 1 - 9 files changed, 9 deletions(-) diff --git a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/expected.template.yaml b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/expected.template.yaml index b985f6b43a..0bf9810248 100644 --- a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/expected.template.yaml +++ b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/expected.template.yaml @@ -135,7 +135,6 @@ Resources: LayerName: my_layer CompatibleRuntimes: - python3.9 - - python3.9 Content: aws-sam-cli/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/my_layer_code Metadata: SamResourceId: aws_lambda_layer_version.from_local diff --git a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_windows/expected.template.yaml b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_windows/expected.template.yaml index b985f6b43a..0bf9810248 100644 --- a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_windows/expected.template.yaml +++ b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_windows/expected.template.yaml @@ -135,7 +135,6 @@ Resources: LayerName: my_layer CompatibleRuntimes: - python3.9 - - python3.9 Content: aws-sam-cli/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/my_layer_code Metadata: SamResourceId: aws_lambda_layer_version.from_local diff --git a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend/expected.template.yaml b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend/expected.template.yaml index 2ec58d8e73..114b8aab98 100644 --- a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend/expected.template.yaml +++ b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend/expected.template.yaml @@ -135,7 +135,6 @@ Resources: LayerName: my_layer CompatibleRuntimes: - python3.9 - - python3.9 Content: aws-sam-cli/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend/my_layer_code Metadata: SamResourceId: aws_lambda_layer_version.from_local diff --git a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_container_windows/expected.template.yaml b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_container_windows/expected.template.yaml index b985f6b43a..0bf9810248 100644 --- a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_container_windows/expected.template.yaml +++ b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_container_windows/expected.template.yaml @@ -135,7 +135,6 @@ Resources: LayerName: my_layer CompatibleRuntimes: - python3.9 - - python3.9 Content: aws-sam-cli/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/my_layer_code Metadata: SamResourceId: aws_lambda_layer_version.from_local diff --git a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_windows/expected.template.yaml b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_windows/expected.template.yaml index b985f6b43a..0bf9810248 100644 --- a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_windows/expected.template.yaml +++ b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_windows/expected.template.yaml @@ -135,7 +135,6 @@ Resources: LayerName: my_layer CompatibleRuntimes: - python3.9 - - python3.9 Content: aws-sam-cli/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/my_layer_code Metadata: SamResourceId: aws_lambda_layer_version.from_local diff --git a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions.json b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions.json index c77fae6920..9583d595d4 100644 --- a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions.json +++ b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions.json @@ -42,7 +42,6 @@ } }, "CompatibleRuntimes": [ - "python3.9", "python3.9", "python3.11", "python3.12" diff --git a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions_after.json b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions_after.json index 6dd45a33cf..1df29132eb 100644 --- a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions_after.json +++ b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions_after.json @@ -42,7 +42,6 @@ } }, "CompatibleRuntimes": [ - "python3.9", "python3.9", "python3.11", "python3.12" diff --git a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions.json b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions.json index f858fa1f5f..30eba9b98e 100644 --- a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions.json +++ b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions.json @@ -42,7 +42,6 @@ } }, "CompatibleRuntimes": [ - "python3.9", "python3.9", "python3.11", "python3.12" diff --git a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions_after.json b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions_after.json index f2d957f3b9..871e8aaa53 100644 --- a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions_after.json +++ b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions_after.json @@ -42,7 +42,6 @@ } }, "CompatibleRuntimes": [ - "python3.9", "python3.9", "python3.11", "python3.12" From 6bd3eb5b36b3da366d52bcb06991929a70953d2e Mon Sep 17 00:00:00 2001 From: Renato Valenzuela <37676028+valerena@users.noreply.github.com> Date: Thu, 6 Feb 2025 17:58:21 -0800 Subject: [PATCH 3/3] test: Fix Terraform Docker container (#7873) Terraform Docker container was trying to use python3.9 on AL2, which doesn't exist. Migrate to AL2023, which already has python3.9 installed (so we don't even need to install it) --- .../buildcmd/terraform/build_image_docker/Dockerfile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/integration/testdata/buildcmd/terraform/build_image_docker/Dockerfile b/tests/integration/testdata/buildcmd/terraform/build_image_docker/Dockerfile index 1d78793731..eb1c475ceb 100644 --- a/tests/integration/testdata/buildcmd/terraform/build_image_docker/Dockerfile +++ b/tests/integration/testdata/buildcmd/terraform/build_image_docker/Dockerfile @@ -1,9 +1,7 @@ -FROM public.ecr.aws/amazonlinux/amazonlinux:2 +FROM public.ecr.aws/amazonlinux/amazonlinux:2023 RUN yum -y update \ - && yum install -y unzip tar gzip bzip2-devel ed gcc gcc-c++ gcc-gfortran \ - less libcurl-devel openssl openssl-devel readline-devel xz-devel \ - zlib-devel glibc-static libcxx libcxx-devel llvm-toolset-7 zlib-static \ + && yum install -y unzip tar gzip ed less \ && rm -rf /var/cache/yum RUN yum -y install make \ @@ -15,11 +13,9 @@ RUN yum install -y yum-utils \ && terraform --version # AWS Lambda Builders -RUN amazon-linux-extras enable python3.9 -RUN yum clean metadata && yum -y install python3.9 +# AL2023 uses Python3.9 by default. This might fail in the future if that changes. We just need the proper version RUN curl -L get-pip.io | python3.9 RUN pip3 install aws-lambda-builders -RUN ln -s /usr/bin/python3.9 /usr/bin/python3 RUN python3 --version VOLUME /project