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

test: Remove python3.8 from integ tests #7862

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/integration/deploy/test_deploy_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ class TestDeploy(DeployIntegBase):
def setUpClass(cls):
cls.docker_client = docker.from_env()
cls.local_images = [
("public.ecr.aws/sam/emulation-python3.8", "latest"),
("public.ecr.aws/sam/emulation-python3.9", "latest"),
]
# setup some images locally by pulling them.
for repo, tag in cls.local_images:
cls.docker_client.api.pull(repository=repo, tag=tag)
cls.docker_client.api.tag(f"{repo}:{tag}", "emulation-python3.8", tag="latest")
cls.docker_client.api.tag(f"{repo}:{tag}", "emulation-python3.8-2", tag="latest")
cls.docker_client.api.tag(f"{repo}:{tag}", "emulation-python3.9", tag="latest")
cls.docker_client.api.tag(f"{repo}:{tag}", "emulation-python3.9-2", tag="latest")
cls.docker_client.api.tag(f"{repo}:{tag}", "colorsrandomfunctionf61b9209", tag="latest")

# setup signing profile arn & name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def setUpClass(cls):
bytes('resource "aws_lambda_function" "this" {' + os.linesep, "utf-8"),
bytes(" filename = var.source_code" + os.linesep, "utf-8"),
bytes(' handler = "app.lambda_handler"' + os.linesep, "utf-8"),
bytes(' runtime = "python3.8"' + os.linesep, "utf-8"),
bytes(' runtime = "python3.9"' + os.linesep, "utf-8"),
bytes(" function_name = var.function_name" + os.linesep, "utf-8"),
bytes(" role = aws_iam_role.iam_for_lambda.arn" + os.linesep, "utf-8"),
bytes(f' layers = ["{_4th_layer_arn}"]' + os.linesep, "utf-8"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def setUpClass(cls):
bytes('resource "aws_lambda_function" "this" {' + os.linesep, "utf-8"),
bytes(" filename = var.source_code" + os.linesep, "utf-8"),
bytes(' handler = "app.lambda_handler"' + os.linesep, "utf-8"),
bytes(' runtime = "python3.8"' + os.linesep, "utf-8"),
bytes(' runtime = "python3.9"' + os.linesep, "utf-8"),
bytes(" function_name = var.function_name" + os.linesep, "utf-8"),
bytes(" role = aws_iam_role.iam_for_lambda.arn" + os.linesep, "utf-8"),
bytes(f' layers = ["{_4th_layer_arn}"]' + os.linesep, "utf-8"),
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/package/test_package_command_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ class TestPackageImage(PackageIntegBase):
def setUpClass(cls):
cls.docker_client = docker.from_env()
cls.local_images = [
("public.ecr.aws/sam/emulation-python3.8", "latest"),
("public.ecr.aws/sam/emulation-python3.9", "latest"),
]
# setup some images locally by pulling them.
for repo, tag in cls.local_images:
cls.docker_client.api.pull(repository=repo, tag=tag)
cls.docker_client.api.tag(f"{repo}:{tag}", "emulation-python3.8", tag="latest")
cls.docker_client.api.tag(f"{repo}:{tag}", "emulation-python3.8-2", tag="latest")
cls.docker_client.api.tag(f"{repo}:{tag}", "emulation-python3.9", tag="latest")
cls.docker_client.api.tag(f"{repo}:{tag}", "emulation-python3.9-2", tag="latest")
cls.docker_client.api.tag(f"{repo}:{tag}", "colorsrandomfunctionf61b9209", tag="latest")

super(TestPackageImage, cls).setUpClass()
Expand Down Expand Up @@ -264,8 +264,8 @@ def test_package_with_deep_nested_template_image(self):

# verify all function images are pushed
images = [
("emulation-python3.8", "latest"),
("emulation-python3.8-2", "latest"),
("emulation-python3.9", "latest"),
("emulation-python3.9-2", "latest"),
]
for image, tag in images:
# check string like this:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ Resources:
Properties:
CodeUri: ../Python
Handler: main.handler
Runtime: python3.8
Runtime: python3.9
Layers:
- !Ref Layer
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Resources:
LayerName: MyLayerInChild
ContentUri: ../PyLayer
CompatibleRuntimes:
- python3.8
- python3.9
Metadata:
BuildMethod: python3.8
BuildMethod: python3.9

Outputs:
LayerVersion:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Resources:
LayerName: MyLayerInRoot
ContentUri: ../PyLayer
CompatibleRuntimes:
- python3.8
- python3.9
Metadata:
BuildMethod: python3.8
BuildMethod: python3.9

AppUsingRef:
Type: AWS::Serverless::Application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Resources:
Properties:
CodeUri: ../Python
Handler: main.handler
Runtime: python3.8
Runtime: python3.9
Layers:
- !GetAtt ChildApp.Outputs.LayerVersion
20 changes: 10 additions & 10 deletions tests/integration/testdata/buildcmd/template-with-s3-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: app.handler
Runtime: python3.8
Runtime: python3.9
CodeUri: s3://some/path
Timeout: 600

IgnoreServerlessFunction2:
Type: AWS::Serverless::Function
Properties:
Handler: app.handler
Runtime: python3.8
Runtime: python3.9
CodeUri:
Bucket: some-bucket
Key: some-key
Expand All @@ -25,15 +25,15 @@ Resources:
Type: AWS::Lambda::Function
Properties:
Handler: app.handler
Runtime: python3.8
Runtime: python3.9
Code: s3://some/path
Timeout: 600

IgnoreLambdaFunction2:
Type: AWS::Lambda::Function
Properties:
Handler: app.handler
Runtime: python3.8
Runtime: python3.9
Code:
S3Bucket: some-bucket
S3Key: some-key
Expand All @@ -44,7 +44,7 @@ Resources:
Properties:
ContentUri: s3://some/path
CompatibleRuntimes:
- python3.8
- python3.9

IgnoreServerlessLayer2:
Type: AWS::Serverless::LayerVersion
Expand All @@ -53,14 +53,14 @@ Resources:
Bucket: some-bucket
Key: some-key
CompatibleRuntimes:
- python3.8
- python3.9

IgnoreLambdaLayer:
Type: AWS::Lambda::LayerVersion
Properties:
Content: s3://some/path
CompatibleRuntimes:
- python3.8
- python3.9

IgnoreLambdaLayer2:
Type: AWS::Lambda::LayerVersion
Expand All @@ -69,14 +69,14 @@ Resources:
S3Bucket: some-bucket
S3Key: some-key
CompatibleRuntimes:
- python3.8
- python3.9

# the two functions below should still be built even all layers are not available
ServerlessFunction:
Type: AWS::Serverless::Function
Properties:
Handler: main.handler
Runtime: python3.8
Runtime: python3.9
CodeUri: Python
Timeout: 600
Layers:
Expand All @@ -89,7 +89,7 @@ Resources:
Type: AWS::Lambda::Function
Properties:
Handler: main.handler
Runtime: python3.8
Runtime: python3.9
Code: Python
Timeout: 600
Layers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: app.handler
Runtime: python3.8
Runtime: python3.9
CodeUri: /some/path/file.zip
Timeout: 600

IgnoreLambdaFunction:
Type: AWS::Lambda::Function
Properties:
Handler: app.handler
Runtime: python3.8
Runtime: python3.9
Code: some/path/file.zip
Timeout: 600

Expand All @@ -24,11 +24,11 @@ Resources:
Properties:
ContentUri: ./some.zip
CompatibleRuntimes:
- python3.8
- python3.9

IgnoreLambdaLayer:
Type: AWS::Lambda::LayerVersion
Properties:
Content: some.zip
CompatibleRuntimes:
- python3.8
- python3.9
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ EOF
resource "aws_lambda_function" "this" {
filename = var.source_code
handler = "app.lambda_handler"
runtime = "python3.8"
runtime = "python3.9"
function_name = var.function_name
role = aws_iam_role.iam_for_lambda.arn
layers = var.layers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "aws_lambda_layer_version" "layer" {
filename = var.source_code
layer_name = var.name

compatible_runtimes = ["python3.8"]
compatible_runtimes = ["python3.9"]
}

output "arn" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.8"]
compatible_runtimes = ["python3.9"]
depends_on = [
null_resource.build_layer1_version
]
Expand Down Expand Up @@ -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.8"
runtime = "python3.9"
function_name = "function1"
timeout = 300
role = aws_iam_role.iam_for_lambda.arn
Expand Down Expand Up @@ -174,8 +174,8 @@ module "layer7" {
version = "4.6.0"
create_layer = true
layer_name = "lambda_layer7"
compatible_runtimes = ["python3.8"]
runtime = "python3.8"
compatible_runtimes = ["python3.9"]
runtime = "python3.9"
source_path = {
path = local.layer1_src_path
prefix_in_zip = "python"
Expand All @@ -190,6 +190,6 @@ module "function7" {
source_path = local.hello_world_function_src_path
function_name = "function7"
handler = "app.lambda_handler"
runtime = "python3.8"
runtime = "python3.9"
layers = [module.layer7.lambda_layer_arn]
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ EOF
resource "aws_lambda_function" "this" {
filename = var.source_code
handler = "app.lambda_handler"
runtime = "python3.8"
runtime = "python3.9"
function_name = var.function_name
role = aws_iam_role.iam_for_lambda.arn
layers = var.layers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "aws_lambda_layer_version" "layer" {
filename = var.source_code
layer_name = var.name

compatible_runtimes = ["python3.8"]
compatible_runtimes = ["python3.9"]
}

output "arn" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.8"]
compatible_runtimes = ["python3.9"]
depends_on = [
null_resource.build_layer1_version
]
Expand Down Expand Up @@ -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.8"
runtime = "python3.9"
function_name = "function1"
timeout = 300
role = aws_iam_role.iam_for_lambda.arn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ EOF
resource "aws_lambda_function" "this" {
filename = var.source_code
handler = "app.lambda_handler"
runtime = "python3.8"
runtime = "python3.9"
function_name = var.function_name
role = aws_iam_role.iam_for_lambda.arn
layers = var.layers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "aws_lambda_layer_version" "layer" {
filename = var.source_code
layer_name = var.name

compatible_runtimes = ["python3.8"]
compatible_runtimes = ["python3.9"]
}

output "arn" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.8"]
compatible_runtimes = ["python3.9"]
depends_on = [
null_resource.build_layer1_version
]
Expand Down Expand Up @@ -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.8"
runtime = "python3.9"
function_name = "function1"
timeout = 300
role = aws_iam_role.iam_for_lambda.arn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "aws_lambda_function" "s3_lambda" {
s3_bucket = "lambda_code_bucket"
s3_key = "s3_lambda_code_key"
handler = "app.lambda_handler"
runtime = "python3.8"
runtime = "python3.9"
function_name = "s3_lambda_function"
timeout = 500
role = aws_iam_role.iam_for_lambda.arn
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ RUN yum install -y yum-utils \
&& terraform --version

# AWS Lambda Builders
RUN amazon-linux-extras enable python3.8
RUN yum clean metadata && yum -y install python3.8
RUN curl -L get-pip.io | python3.8
RUN amazon-linux-extras enable python3.9
RUN yum clean metadata && yum -y install python3.9
RUN curl -L get-pip.io | python3.9
RUN pip3 install aws-lambda-builders
RUN ln -s /usr/bin/python3.8 /usr/bin/python3
RUN ln -s /usr/bin/python3.9 /usr/bin/python3
RUN python3 --version

VOLUME /project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resource "aws_lambda_function" "function" {
s3_bucket = aws_s3_bucket.lambda_functions_code_bucket.id
s3_key = "s3_lambda_code_key"
handler = "app.lambda_handler"
runtime = "python3.8"
runtime = "python3.9"
function_name = "s3_lambda_function"
timeout = 500
role = aws_iam_role.iam_for_lambda.arn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "aws_lambda_function" "s3_lambda" {
s3_bucket = "lambda_code_bucket"
s3_key = "s3_lambda_code_key"
handler = "app.lambda_handler"
runtime = "python3.8"
runtime = "python3.9"
function_name = "s3_lambda_function"
timeout = 500
role = aws_iam_role.iam_for_lambda.arn
Expand Down
Loading
Loading