Skip to content

Commit 1d2c21a

Browse files
committed
Update snapshots and missing files to get tests to pass
1 parent 46ddf1c commit 1d2c21a

File tree

10 files changed

+135
-0
lines changed

10 files changed

+135
-0
lines changed

tests/aws/services/apigateway/resources/test_apigateway.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ def test_cfn_deploy_apigateway_models(deploy_cfn_template, snapshot, aws_client)
265265

266266

267267
@markers.aws.validated
268+
@markers.snapshot.skip_snapshot_verify(paths=["$..endpointConfiguration.ipAddressType"])
268269
def test_cfn_deploy_apigateway_integration(deploy_cfn_template, snapshot, aws_client):
269270
snapshot.add_transformer(snapshot.transform.key_value("cacheNamespace"))
270271

@@ -301,6 +302,7 @@ def test_cfn_deploy_apigateway_integration(deploy_cfn_template, snapshot, aws_cl
301302
"$.get-stage.lastUpdatedDate",
302303
"$.get-stage.methodSettings",
303304
"$.get-stage.tags",
305+
"$..endpointConfiguration.ipAddressType",
304306
]
305307
)
306308
def test_cfn_deploy_apigateway_from_s3_swagger(
@@ -482,6 +484,7 @@ def test_update_apigateway_stage(deploy_cfn_template, snapshot, aws_client):
482484

483485

484486
@markers.aws.validated
487+
@markers.snapshot.skip_snapshot_verify(paths=["$..endpointConfiguration.ipAddressType"])
485488
def test_api_gateway_with_policy_as_dict(deploy_cfn_template, snapshot, aws_client):
486489
template = """
487490
Parameters:
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"tests/aws/services/cloudformation/resources/test_sam.py::test_sam_policies": {
3+
"recorded-date": "11-07-2023, 18:08:53",
4+
"recorded-content": {
5+
"list_attached_role_policies": {
6+
"AttachedPolicies": [
7+
{
8+
"PolicyArn": "arn:<partition>:iam::aws:policy/service-role/<policy-name:1>",
9+
"PolicyName": "<policy-name:1>"
10+
},
11+
{
12+
"PolicyArn": "arn:<partition>:iam::aws:policy/<policy-name:2>",
13+
"PolicyName": "<policy-name:2>"
14+
}
15+
],
16+
"IsTruncated": false,
17+
"ResponseMetadata": {
18+
"HTTPHeaders": {},
19+
"HTTPStatusCode": 200
20+
}
21+
}
22+
}
23+
},
24+
"tests/aws/services/cloudformation/resources/test_sam.py::test_cfn_handle_serverless_api_resource": {
25+
"recorded-date": "20-06-2024, 20:16:01",
26+
"recorded-content": {
27+
"get_rest_api": {
28+
"apiKeySource": "HEADER",
29+
"createdDate": "datetime",
30+
"disableExecuteApiEndpoint": false,
31+
"endpointConfiguration": {
32+
"types": [
33+
"EDGE"
34+
]
35+
},
36+
"id": "<id:1>",
37+
"name": "<name:1>",
38+
"rootResourceId": "<root-resource-id:1>",
39+
"tags": {
40+
"aws:cloudformation:logical-id": "Api",
41+
"aws:cloudformation:stack-id": "arn:<partition>:cloudformation:<region>:111111111111:stack/<name:1>/<resource:1>",
42+
"aws:cloudformation:stack-name": "<name:1>"
43+
},
44+
"version": "1.0",
45+
"ResponseMetadata": {
46+
"HTTPHeaders": {},
47+
"HTTPStatusCode": 200
48+
}
49+
},
50+
"get_function": {
51+
"Code": {
52+
"Location": "<location>",
53+
"RepositoryType": "S3"
54+
},
55+
"Configuration": {
56+
"Architectures": [
57+
"x86_64"
58+
],
59+
"CodeSha256": "+xvKfGS3ENINs/yK7dLJgId2fDM+vv9OP03rJ9mLflU=",
60+
"CodeSize": "<code-size>",
61+
"Description": "",
62+
"EphemeralStorage": {
63+
"Size": 512
64+
},
65+
"FunctionArn": "arn:<partition>:lambda:<region>:111111111111:function:<function-name:1>",
66+
"FunctionName": "<function-name:1>",
67+
"Handler": "index.handler",
68+
"LastModified": "date",
69+
"LastUpdateStatus": "Successful",
70+
"LoggingConfig": {
71+
"LogFormat": "Text",
72+
"LogGroup": "/aws/lambda/<function-name:1>"
73+
},
74+
"MemorySize": 128,
75+
"PackageType": "Zip",
76+
"RevisionId": "<uuid:1>",
77+
"Role": "arn:<partition>:iam::111111111111:role/<resource:2>",
78+
"Runtime": "python3.11",
79+
"RuntimeVersionConfig": {
80+
"RuntimeVersionArn": "arn:<partition>:lambda:<region>::runtime:<resource:3>"
81+
},
82+
"SnapStart": {
83+
"ApplyOn": "None",
84+
"OptimizationStatus": "Off"
85+
},
86+
"State": "Active",
87+
"Timeout": 3,
88+
"TracingConfig": {
89+
"Mode": "PassThrough"
90+
},
91+
"Version": "$LATEST"
92+
},
93+
"Tags": {
94+
"aws:cloudformation:logical-id": "Lambda",
95+
"aws:cloudformation:stack-id": "arn:<partition>:cloudformation:<region>:111111111111:stack/<name:1>/<resource:1>",
96+
"aws:cloudformation:stack-name": "<name:1>",
97+
"lambda:createdBy": "SAM"
98+
},
99+
"ResponseMetadata": {
100+
"HTTPHeaders": {},
101+
"HTTPStatusCode": 200
102+
}
103+
}
104+
}
105+
}
106+
}

tests/aws/services/cloudwatch/resources/test_cloudwatch.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def test_alarm_creation(deploy_cfn_template, snapshot):
4848
"$..StateReason",
4949
"$..StateReasonData",
5050
"$..StateValue",
51+
# only for v1
52+
"$..StateTransitionedTimestamp",
5153
]
5254
)
5355
def test_composite_alarm_creation(aws_client, deploy_cfn_template, snapshot):
@@ -94,6 +96,12 @@ def alarm_action_name_transformer(key: str, val: str):
9496

9597

9698
@markers.aws.validated
99+
@markers.snapshot.skip_snapshot_verify(
100+
paths=[
101+
# only for v1
102+
"$..StateTransitionedTimestamp",
103+
]
104+
)
97105
def test_alarm_ext_statistic(aws_client, deploy_cfn_template, snapshot):
98106
snapshot.add_transformer(snapshot.transform.cloudwatch_api())
99107
stack = deploy_cfn_template(

tests/aws/services/dynamodb/resources/test_dynamodb.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def test_globalindex_read_write_provisioned_throughput_dynamodb_table(
6969
"$..Table.ProvisionedThroughput.LastIncreaseDateTime",
7070
"$..Table.Replicas",
7171
"$..Table.DeletionProtectionEnabled",
72+
"$..Table.WarmThroughput",
7273
]
7374
)
7475
def test_default_name_for_table(deploy_cfn_template, snapshot, aws_client):
@@ -94,6 +95,7 @@ def test_default_name_for_table(deploy_cfn_template, snapshot, aws_client):
9495
"$..Table.ProvisionedThroughput.LastIncreaseDateTime",
9596
"$..Table.Replicas",
9697
"$..Table.DeletionProtectionEnabled",
98+
"$..Table.WarmThroughput",
9799
]
98100
)
99101
@pytest.mark.parametrize("billing_mode", ["PROVISIONED", "PAY_PER_REQUEST"])
@@ -121,6 +123,7 @@ def test_billing_mode_as_conditional(deploy_cfn_template, snapshot, aws_client,
121123
"$..Table.ProvisionedThroughput.LastDecreaseDateTime",
122124
"$..Table.ProvisionedThroughput.LastIncreaseDateTime",
123125
"$..Table.Replicas",
126+
"$..Table.WarmThroughput",
124127
]
125128
)
126129
def test_global_table(deploy_cfn_template, snapshot, aws_client, region_name):

tests/aws/services/ec2/resources/test_ec2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def test_dhcp_options(aws_client, deploy_cfn_template, snapshot):
155155
"$..Tags",
156156
"$..Options.AssociationDefaultRouteTableId",
157157
"$..Options.PropagationDefaultRouteTableId",
158+
"$..Options.SecurityGroupReferencingSupport",
158159
]
159160
)
160161
def test_transit_gateway_attachment(deploy_cfn_template, aws_client, snapshot):

tests/aws/services/es/resources/test_elasticsearch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
"$..DomainStatus.ElasticsearchClusterConfig.InstanceCount",
1818
"$..DomainStatus.ElasticsearchClusterConfig.ZoneAwarenessConfig",
1919
"$..DomainStatus.ElasticsearchClusterConfig.ZoneAwarenessEnabled",
20+
"$..DomainStatus.ElasticsearchClusterConfig.DedicatedMasterType",
21+
"$..DomainStatus.ElasticsearchClusterConfig.InstanceType",
2022
"$..DomainStatus.Endpoint",
2123
"$..DomainStatus.ModifyingProperties",
2224
"$..DomainStatus.Processing",

tests/aws/services/lambda_/resources/test_lambda.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ class TestCfnLambdaIntegrations:
589589
"$..CodeSize",
590590
"$..Configuration.Layers",
591591
"$..Tags", # missing cloudformation automatic resource tags for the lambda function
592+
"$..RevisionId",
592593
]
593594
)
594595
@markers.aws.validated
@@ -823,6 +824,7 @@ def _send_events():
823824
"$..Table.Replicas",
824825
# stream result
825826
"$..StreamDescription.CreationRequestDateTime",
827+
"$..Table.WarmThroughput",
826828
]
827829
)
828830
@markers.aws.validated

tests/aws/services/opensearch/resources/test_opensearch.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ def test_domain(deploy_cfn_template, aws_client, snapshot):
7272
"$..DomainStatus.OffPeakWindowOptions",
7373
"$..DomainStatus.ServiceSoftwareOptions.CurrentVersion",
7474
"$..DomainStatus.SoftwareUpdateOptions",
75+
"$..DomainStatus.AIMLOptions",
76+
"$..DomainStatus.ClusterConfig.DedicatedMasterType",
77+
"$..DomainStatus.ClusterConfig.InstanceType",
78+
"$..DomainStatus.DomainEndpointOptions.TLSSecurityPolicy",
79+
"$..DomainStatus.DomainProcessingStatus",
80+
"$..DomainStatus.IPAddressType",
81+
"$..DomainStatus.IdentityCenterOptions",
82+
"$..DomainStatus.ModifyingProperties",
7583
]
7684
)
7785
def test_domain_with_alternative_types(deploy_cfn_template, aws_client, snapshot):

tests/aws/services/s3/resources/test_s3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def test_website_configuration(deploy_cfn_template, snapshot, aws_client):
8686

8787

8888
@markers.aws.validated
89+
@markers.snapshot.skip_snapshot_verify(paths=["$..CORSRules..MaxAgeSeconds"])
8990
def test_cors_configuration(deploy_cfn_template, snapshot, aws_client):
9091
snapshot.add_transformer(snapshot.transform.cloudformation_api())
9192
snapshot.add_transformer(snapshot.transform.s3_api())

tests/aws/services/sns/resources/test_sns.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def test_deploy_stack_with_sns_topic(deploy_cfn_template, aws_client):
104104

105105

106106
@markers.aws.validated
107+
@markers.snapshot.skip_snapshot_verify(paths=["$..Attributes.SubscriptionPrincipal"])
107108
def test_update_subscription(snapshot, deploy_cfn_template, aws_client, sqs_queue, sns_topic):
108109
topic_arn = sns_topic["Attributes"]["TopicArn"]
109110
queue_url = sqs_queue

0 commit comments

Comments
 (0)