diff --git a/tests/integration/deploy/test_deploy_command.py b/tests/integration/deploy/test_deploy_command.py index 878607f8b3..b9cd1a82f1 100644 --- a/tests/integration/deploy/test_deploy_command.py +++ b/tests/integration/deploy/test_deploy_command.py @@ -37,6 +37,8 @@ def setUpClass(cls): # 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") + # setup signing profile arn & name cls.signing_profile_name = os.environ.get("AWS_SIGNING_PROFILE_NAME") cls.signing_profile_version_arn = os.environ.get("AWS_SIGNING_PROFILE_VERSION_ARN") diff --git a/tests/integration/package/test_package_command_image.py b/tests/integration/package/test_package_command_image.py index a30bc880e6..cedab01bd0 100644 --- a/tests/integration/package/test_package_command_image.py +++ b/tests/integration/package/test_package_command_image.py @@ -32,6 +32,9 @@ def setUpClass(cls): # 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") + super(TestPackageImage, cls).setUpClass() def setUp(self): @@ -200,14 +203,10 @@ def test_package_with_deep_nested_template_image(self): raise process_stderr = stderr.strip().decode("utf-8") - # there are in total 3 function images and 2 child template file to upload - # verify both child templates are uploaded - uploads = re.findall(r"\.template", process_stderr) - self.assertEqual(len(uploads), 2) - # verify all function images are pushed images = [ - ("public.ecr.aws/sam/emulation-python3.8", "latest"), + ("emulation-python3.8", "latest"), + ("emulation-python3.8-2", "latest"), ] for image, tag in images: # check string like this: diff --git a/tests/integration/testdata/package/aws-lambda-function-image-and-api.yaml b/tests/integration/testdata/package/aws-lambda-function-image-and-api.yaml index c68162e5c1..38cc761756 100644 --- a/tests/integration/testdata/package/aws-lambda-function-image-and-api.yaml +++ b/tests/integration/testdata/package/aws-lambda-function-image-and-api.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Lambda::Function Properties: PackageType: Image - Code: public.ecr.aws/sam/emulation-python3.8:latest + Code: "emulation-python3.8:latest" Role: Fn::GetAtt: - "LambdaExecutionRole" diff --git a/tests/integration/testdata/package/aws-lambda-function-image.yaml b/tests/integration/testdata/package/aws-lambda-function-image.yaml index fa55f20f7b..11f4c681fd 100644 --- a/tests/integration/testdata/package/aws-lambda-function-image.yaml +++ b/tests/integration/testdata/package/aws-lambda-function-image.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Lambda::Function Properties: PackageType: Image - Code: public.ecr.aws/sam/emulation-python3.8:latest + Code: emulation-python3.8:latest Role: Fn::GetAtt: - "LambdaExecutionRole" diff --git a/tests/integration/testdata/package/aws-serverless-function-image.yaml b/tests/integration/testdata/package/aws-serverless-function-image.yaml index 074b83eaae..f5864bebb5 100644 --- a/tests/integration/testdata/package/aws-serverless-function-image.yaml +++ b/tests/integration/testdata/package/aws-serverless-function-image.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: PackageType: Image - ImageUri: public.ecr.aws/sam/emulation-python3.8:latest + ImageUri: emulation-python3.8:latest Events: HelloWorld: Type: Api diff --git a/tests/integration/testdata/package/deep-nested-image/ChildStackX/ChildStackY/template.yaml b/tests/integration/testdata/package/deep-nested-image/ChildStackX/ChildStackY/template.yaml index d32105ab84..2fc93a6bfe 100644 --- a/tests/integration/testdata/package/deep-nested-image/ChildStackX/ChildStackY/template.yaml +++ b/tests/integration/testdata/package/deep-nested-image/ChildStackX/ChildStackY/template.yaml @@ -7,4 +7,4 @@ Resources: Type: AWS::Serverless::Function Properties: PackageType: Image - ImageUri: public.ecr.aws/sam/emulation-python3.8:latest \ No newline at end of file + ImageUri: emulation-python3.8:latest \ No newline at end of file diff --git a/tests/integration/testdata/package/deep-nested-image/ChildStackX/template.yaml b/tests/integration/testdata/package/deep-nested-image/ChildStackX/template.yaml index 597f332d22..0c26cd70e5 100644 --- a/tests/integration/testdata/package/deep-nested-image/ChildStackX/template.yaml +++ b/tests/integration/testdata/package/deep-nested-image/ChildStackX/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: PackageType: Image - ImageUri: public.ecr.aws/sam/emulation-python3.8:latest + ImageUri: emulation-python3.8-2:latest ChildStackY: Type: AWS::Serverless::Application diff --git a/tests/integration/testdata/package/deep-nested-image/template.yaml b/tests/integration/testdata/package/deep-nested-image/template.yaml index c2f304ddd8..c464e77194 100644 --- a/tests/integration/testdata/package/deep-nested-image/template.yaml +++ b/tests/integration/testdata/package/deep-nested-image/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: PackageType: Image - ImageUri: public.ecr.aws/sam/emulation-python3.8:latest + ImageUri: emulation-python3.8:latest ChildStackX: Type: AWS::Serverless::Application