diff --git a/tests/install-rust.sh b/tests/install-rust.sh index 3698c21a50..93fa8f0c6c 100755 --- a/tests/install-rust.sh +++ b/tests/install-rust.sh @@ -31,6 +31,13 @@ rustup default stable if [[ "${RUNNER_OS:-}" == "Windows" ]]; then # On Windows, add Windows-native targets rustup target add x86_64-pc-windows-msvc --toolchain stable || true + # Also pre-install the Linux cross-compile targets used by cargo-lambda. + # If cargo-lambda has to install these on demand during parallel test runs + # (pytest -n 2), concurrent rustup invocations can produce a partial/corrupt + # target install (e.g., "can't find crate for `adler2`"). Pre-installing here + # avoids that race. + rustup target add x86_64-unknown-linux-gnu --toolchain stable + rustup target add aarch64-unknown-linux-gnu --toolchain stable else rustup target add x86_64-unknown-linux-gnu --toolchain stable rustup target add aarch64-unknown-linux-gnu --toolchain stable diff --git a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/modules/lambda_function/main.tf b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/modules/lambda_function/main.tf index 52baf96f91..bae31fbaac 100644 --- a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/modules/lambda_function/main.tf +++ b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/modules/lambda_function/main.tf @@ -34,7 +34,7 @@ EOF resource "aws_lambda_function" "this" { filename = var.source_code handler = "app.lambda_handler" - runtime = "python3.9" + runtime = "python3.12" function_name = var.function_name role = aws_iam_role.iam_for_lambda.arn layers = var.layers diff --git a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/modules/lambda_layer/main.tf b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/modules/lambda_layer/main.tf index 67ef4fc6c5..c443f0c769 100644 --- a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/modules/lambda_layer/main.tf +++ b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/modules/lambda_layer/main.tf @@ -10,7 +10,7 @@ resource "aws_lambda_layer_version" "layer" { filename = var.source_code layer_name = var.name - compatible_runtimes = ["python3.9"] + compatible_runtimes = ["python3.12"] } output "arn" { diff --git a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/root_module/main.tf b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/root_module/main.tf index ca87fbc4bf..82a13dfa2c 100644 --- a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/root_module/main.tf +++ b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory/root_module/main.tf @@ -61,7 +61,7 @@ resource "aws_lambda_layer_version" "layer1" { count = 1 filename = "${local.building_path}/${local.layer1_artifact_file_name}" layer_name = "lambda_layer1" - compatible_runtimes = ["python3.9"] + compatible_runtimes = ["python3.12"] depends_on = [ null_resource.build_layer1_version ] @@ -96,7 +96,7 @@ resource "null_resource" "sam_metadata_aws_lambda_function1" { resource "aws_lambda_function" "function1" { filename = "${local.building_path}/${local.hello_world_artifact_file_name}" handler = "app.lambda_handler" - runtime = "python3.9" + runtime = "python3.12" function_name = "function1" timeout = 300 role = aws_iam_role.iam_for_lambda.arn @@ -174,8 +174,8 @@ module "layer7" { version = "4.6.0" create_layer = true layer_name = "lambda_layer7" - compatible_runtimes = ["python3.9"] - runtime = "python3.9" + compatible_runtimes = ["python3.12"] + runtime = "python3.12" source_path = { path = local.layer1_src_path prefix_in_zip = "python" @@ -190,6 +190,6 @@ module "function7" { source_path = local.hello_world_function_src_path function_name = "function7" handler = "app.lambda_handler" - runtime = "python3.9" + runtime = "python3.12" layers = [module.layer7.lambda_layer_arn] } \ No newline at end of file diff --git a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/modules/lambda_function/main.tf b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/modules/lambda_function/main.tf index 52baf96f91..bae31fbaac 100644 --- a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/modules/lambda_function/main.tf +++ b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/modules/lambda_function/main.tf @@ -34,7 +34,7 @@ EOF resource "aws_lambda_function" "this" { filename = var.source_code handler = "app.lambda_handler" - runtime = "python3.9" + runtime = "python3.12" function_name = var.function_name role = aws_iam_role.iam_for_lambda.arn layers = var.layers diff --git a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/modules/lambda_layer/main.tf b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/modules/lambda_layer/main.tf index 67ef4fc6c5..c443f0c769 100644 --- a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/modules/lambda_layer/main.tf +++ b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/modules/lambda_layer/main.tf @@ -10,7 +10,7 @@ resource "aws_lambda_layer_version" "layer" { filename = var.source_code layer_name = var.name - compatible_runtimes = ["python3.9"] + compatible_runtimes = ["python3.12"] } output "arn" { diff --git a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/root_module/main.tf b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/root_module/main.tf index 8b965de903..9d8ed8b112 100644 --- a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/root_module/main.tf +++ b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows/root_module/main.tf @@ -61,7 +61,7 @@ resource "aws_lambda_layer_version" "layer1" { count = 1 filename = "${local.building_path}/${local.layer1_artifact_file_name}" layer_name = "lambda_layer1" - compatible_runtimes = ["python3.9"] + compatible_runtimes = ["python3.12"] depends_on = [ null_resource.build_layer1_version ] @@ -96,7 +96,7 @@ resource "null_resource" "sam_metadata_aws_lambda_function1" { resource "aws_lambda_function" "function1" { filename = "${local.building_path}/${local.hello_world_artifact_file_name}" handler = "app.lambda_handler" - runtime = "python3.9" + runtime = "python3.12" function_name = "function1" timeout = 300 role = aws_iam_role.iam_for_lambda.arn diff --git a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/modules/lambda_function/main.tf b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/modules/lambda_function/main.tf index 52baf96f91..bae31fbaac 100644 --- a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/modules/lambda_function/main.tf +++ b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/modules/lambda_function/main.tf @@ -34,7 +34,7 @@ EOF resource "aws_lambda_function" "this" { filename = var.source_code handler = "app.lambda_handler" - runtime = "python3.9" + runtime = "python3.12" function_name = var.function_name role = aws_iam_role.iam_for_lambda.arn layers = var.layers diff --git a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/modules/lambda_layer/main.tf b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/modules/lambda_layer/main.tf index 67ef4fc6c5..c443f0c769 100644 --- a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/modules/lambda_layer/main.tf +++ b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/modules/lambda_layer/main.tf @@ -10,7 +10,7 @@ resource "aws_lambda_layer_version" "layer" { filename = var.source_code layer_name = var.name - compatible_runtimes = ["python3.9"] + compatible_runtimes = ["python3.12"] } output "arn" { diff --git a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/root_module/main.tf b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/root_module/main.tf index 3b49e4d5ee..2c83adc0ef 100644 --- a/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/root_module/main.tf +++ b/tests/integration/testdata/buildcmd/terraform/application_outside_root_directory_windows_container/root_module/main.tf @@ -61,7 +61,7 @@ resource "aws_lambda_layer_version" "layer1" { count = 1 filename = "${local.building_path}/${local.layer1_artifact_file_name}" layer_name = "lambda_layer1" - compatible_runtimes = ["python3.9"] + compatible_runtimes = ["python3.12"] depends_on = [ null_resource.build_layer1_version ] @@ -96,7 +96,7 @@ resource "null_resource" "sam_metadata_aws_lambda_function1" { resource "aws_lambda_function" "function1" { filename = "${local.building_path}/${local.hello_world_artifact_file_name}" handler = "app.lambda_handler" - runtime = "python3.9" + runtime = "python3.12" function_name = "function1" timeout = 300 role = aws_iam_role.iam_for_lambda.arn diff --git a/tests/integration/testdata/validate/multiple_files/template.json b/tests/integration/testdata/validate/multiple_files/template.json index 4945b4ef41..0605be861c 100644 --- a/tests/integration/testdata/validate/multiple_files/template.json +++ b/tests/integration/testdata/validate/multiple_files/template.json @@ -8,7 +8,7 @@ "Properties": { "CodeUri": "hello-world/", "Handler": "app.lambdaHandler", - "Runtime": "nodejs20.x" + "Runtime": "nodejs22.x" } } } diff --git a/tests/integration/testdata/validate/with_build/.aws-sam/build/template.yaml b/tests/integration/testdata/validate/with_build/.aws-sam/build/template.yaml index ccab4ba47c..796d449291 100644 --- a/tests/integration/testdata/validate/with_build/.aws-sam/build/template.yaml +++ b/tests/integration/testdata/validate/with_build/.aws-sam/build/template.yaml @@ -7,4 +7,4 @@ Resources: Properties: CodeUri: HelloWorldFunction Handler: app.lambdaHandler - Runtime: nodejs20.x + Runtime: nodejs22.x diff --git a/tests/integration/testdata/validate/with_build/template.json b/tests/integration/testdata/validate/with_build/template.json index 4945b4ef41..0605be861c 100644 --- a/tests/integration/testdata/validate/with_build/template.json +++ b/tests/integration/testdata/validate/with_build/template.json @@ -8,7 +8,7 @@ "Properties": { "CodeUri": "hello-world/", "Handler": "app.lambdaHandler", - "Runtime": "nodejs20.x" + "Runtime": "nodejs22.x" } } } diff --git a/tests/integration/validate/test_validate_command.py b/tests/integration/validate/test_validate_command.py index 3f99fd032d..fe6942cc4c 100644 --- a/tests/integration/validate/test_validate_command.py +++ b/tests/integration/validate/test_validate_command.py @@ -160,6 +160,7 @@ def test_lint_template(self, relative_folder: str, expected_file: TemplateFileTy ("nodejs18.x",), ("ruby3.2",), ("dotnet6",), + ("nodejs20.x"), ] ) def test_lint_deprecated_runtimes(self, runtime): @@ -211,7 +212,6 @@ def test_lint_supported_runtimes(self): "java17", "java11", "java8.al2", - "nodejs20.x", "nodejs22.x", "nodejs24.x", "provided.al2",