I got the tests to succeed using moto[cloudformation]==4.1.5.
It started succeeding with moto==4.1.10. I chose this because 4.1.11 is where there were some changes to handling duplicate tags, according to the changelog:
ECR: put_image(): now behaves correctly on duplicate images with duplicate tags
When I first tried with moto==4.1.10, test_DockerImage succeeded. However, test_pars_with_new_vpc started to fail at cloudknot/tests/test_pars.py:298:
An error occurred (DependencyViolation) when calling the DeleteStack operation: The vpc vpc-b2ae771a has dependencies and cannot be deleted.
I went back to the moto changelog, and looked for where there were any potential changes to CloudFormation, and found 4.1.6changed how stack deletion was handled:
CloudFormation now supports deletion of AWS::EC2::Subnet, AWS::EC2::VPC
CloudFormation now supports variable mapping inside "Fn::Sub"
CloudFormation: delete_stack() now adheres to "DeletionPolicy": "Retain" set for individual resources
So, I set moto==4.1.5 and it worked!
There is one warning that we might want to check out:
cloudknot/tests/test_knot.py::test_knot
. . . moto/ec2/models/instances.py:140: PendingDeprecationWarning: Could not find AMI with image-id:None, in the near future this will cause an error.
Use ec2_backend.describe_images() to find suitable image for your test
coverage: 0.0%. remained the same
when pulling ef81704693dbfcc26312cf1491145296d42e1dae on maouw:deprecate_addgroup
into 33c73bfff02074fcbd58059b0f04e7360f2ab233 on nrdg:master.
Builds on https://github.com/nrdg/cloudknot/pull/306 to fix failing tests:
I got the tests to succeed using
moto[cloudformation]==4.1.5
.It started succeeding with
moto==4.1.10
. I chose this because4.1.11
is where there were some changes to handling duplicate tags, according to the changelog:When I first tried with
moto==4.1.10
,test_DockerImage
succeeded. However,test_pars_with_new_vpc
started to fail atcloudknot/tests/test_pars.py:298
:I went back to the
moto
changelog, and looked for where there were any potential changes to CloudFormation, and found4.1.6
changed how stack deletion was handled:So, I set
moto==4.1.5
and it worked!There is one warning that we might want to check out:
Originally posted by @maouw in https://github.com/nrdg/cloudknot/issues/306#issuecomment-1918438936