Skip to content

Commit 9cf3a84

Browse files
committed
Update snapshots and missing files to get tests to pass
diff --git c/tests/aws/services/apigateway/resources/test_apigateway.py i/tests/aws/services/apigateway/resources/test_apigateway.py index 199909d..8c304cf 100644 --- c/tests/aws/services/apigateway/resources/test_apigateway.py +++ i/tests/aws/services/apigateway/resources/test_apigateway.py @@ -306,6 +306,7 @@ def test_cfn_deploy_apigateway_models(deploy_cfn_template, snapshot, aws_client) @markers.aws.validated +@markers.snapshot.skip_snapshot_verify(paths=["$..endpointConfiguration.ipAddressType"]) def test_cfn_deploy_apigateway_integration(deploy_cfn_template, snapshot, aws_client): snapshot.add_transformer(snapshot.transform.key_value("cacheNamespace")) @@ -340,6 +341,7 @@ def test_cfn_deploy_apigateway_integration(deploy_cfn_template, snapshot, aws_cl # TODO: missing from LS response "$.get-stage.methodSettings", "$.get-stage.tags", + "$..endpointConfiguration.ipAddressType", ] ) def test_cfn_deploy_apigateway_from_s3_swagger( @@ -538,6 +540,7 @@ def test_update_apigateway_stage(deploy_cfn_template, snapshot, aws_client): @markers.aws.validated +@markers.snapshot.skip_snapshot_verify(paths=["$..endpointConfiguration.ipAddressType"]) def test_api_gateway_with_policy_as_dict(deploy_cfn_template, snapshot, aws_client): template = """ Parameters: diff --git c/tests/aws/services/cloudformation/resources/test_sam.snapshot.json i/tests/aws/services/cloudformation/resources/test_sam.snapshot.json new file mode 100644 index 000000000000..a32c542 --- /dev/null +++ i/tests/aws/services/cloudformation/resources/test_sam.snapshot.json @@ -0,0 +1,106 @@ +{ + "tests/aws/services/cloudformation/resources/test_sam.py::test_sam_policies": { + "recorded-date": "11-07-2023, 18:08:53", + "recorded-content": { + "list_attached_role_policies": { + "AttachedPolicies": [ + { + "PolicyArn": "arn:<partition>:iam::aws:policy/service-role/<policy-name:1>", + "PolicyName": "<policy-name:1>" + }, + { + "PolicyArn": "arn:<partition>:iam::aws:policy/<policy-name:2>", + "PolicyName": "<policy-name:2>" + } + ], + "IsTruncated": false, + "ResponseMetadata": { + "HTTPHeaders": {}, + "HTTPStatusCode": 200 + } + } + } + }, + "tests/aws/services/cloudformation/resources/test_sam.py::test_cfn_handle_serverless_api_resource": { + "recorded-date": "20-06-2024, 20:16:01", + "recorded-content": { + "get_rest_api": { + "apiKeySource": "HEADER", + "createdDate": "datetime", + "disableExecuteApiEndpoint": false, + "endpointConfiguration": { + "types": [ + "EDGE" + ] + }, + "id": "<id:1>", + "name": "<name:1>", + "rootResourceId": "<root-resource-id:1>", + "tags": { + "aws:cloudformation:logical-id": "Api", + "aws:cloudformation:stack-id": "arn:<partition>:cloudformation:<region>:111111111111:stack/<name:1>/<resource:1>", + "aws:cloudformation:stack-name": "<name:1>" + }, + "version": "1.0", + "ResponseMetadata": { + "HTTPHeaders": {}, + "HTTPStatusCode": 200 + } + }, + "get_function": { + "Code": { + "Location": "<location>", + "RepositoryType": "S3" + }, + "Configuration": { + "Architectures": [ + "x86_64" + ], + "CodeSha256": "+xvKfGS3ENINs/yK7dLJgId2fDM+vv9OP03rJ9mLflU=", + "CodeSize": "<code-size>", + "Description": "", + "EphemeralStorage": { + "Size": 512 + }, + "FunctionArn": "arn:<partition>:lambda:<region>:111111111111:function:<function-name:1>", + "FunctionName": "<function-name:1>", + "Handler": "index.handler", + "LastModified": "date", + "LastUpdateStatus": "Successful", + "LoggingConfig": { + "LogFormat": "Text", + "LogGroup": "/aws/lambda/<function-name:1>" + }, + "MemorySize": 128, + "PackageType": "Zip", + "RevisionId": "<uuid:1>", + "Role": "arn:<partition>:iam::111111111111:role/<resource:2>", + "Runtime": "python3.11", + "RuntimeVersionConfig": { + "RuntimeVersionArn": "arn:<partition>:lambda:<region>::runtime:<resource:3>" + }, + "SnapStart": { + "ApplyOn": "None", + "OptimizationStatus": "Off" + }, + "State": "Active", + "Timeout": 3, + "TracingConfig": { + "Mode": "PassThrough" + }, + "Version": "$LATEST" + }, + "Tags": { + "aws:cloudformation:logical-id": "Lambda", + "aws:cloudformation:stack-id": "arn:<partition>:cloudformation:<region>:111111111111:stack/<name:1>/<resource:1>", + "aws:cloudformation:stack-name": "<name:1>", + "lambda:createdBy": "SAM" + }, + "ResponseMetadata": { + "HTTPHeaders": {}, + "HTTPStatusCode": 200 + } + } + } + } +} diff --git c/tests/aws/services/cloudwatch/resources/test_cloudwatch.py i/tests/aws/services/cloudwatch/resources/test_cloudwatch.py index f445f13..e957270 100644 --- c/tests/aws/services/cloudwatch/resources/test_cloudwatch.py +++ i/tests/aws/services/cloudwatch/resources/test_cloudwatch.py @@ -48,6 +48,8 @@ def test_alarm_creation(deploy_cfn_template, snapshot): "$..StateReason", "$..StateReasonData", "$..StateValue", + # only for v1 + "$..StateTransitionedTimestamp", ] ) def test_composite_alarm_creation(aws_client, deploy_cfn_template, snapshot): @@ -94,6 +96,12 @@ def test_composite_alarm_creation(aws_client, deploy_cfn_template, snapshot): @markers.aws.validated +@markers.snapshot.skip_snapshot_verify( + paths=[ + # only for v1 + "$..StateTransitionedTimestamp", + ] +) def test_alarm_ext_statistic(aws_client, deploy_cfn_template, snapshot): snapshot.add_transformer(snapshot.transform.cloudwatch_api()) stack = deploy_cfn_template( diff --git c/tests/aws/services/dynamodb/resources/test_dynamodb.py i/tests/aws/services/dynamodb/resources/test_dynamodb.py index 43c0bb7..d6876e3 100644 --- c/tests/aws/services/dynamodb/resources/test_dynamodb.py +++ i/tests/aws/services/dynamodb/resources/test_dynamodb.py @@ -69,6 +69,7 @@ def test_globalindex_read_write_provisioned_throughput_dynamodb_table( "$..Table.ProvisionedThroughput.LastIncreaseDateTime", "$..Table.Replicas", "$..Table.DeletionProtectionEnabled", + "$..Table.WarmThroughput", ] ) 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): "$..Table.ProvisionedThroughput.LastIncreaseDateTime", "$..Table.Replicas", "$..Table.DeletionProtectionEnabled", + "$..Table.WarmThroughput", ] ) @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, "$..Table.ProvisionedThroughput.LastDecreaseDateTime", "$..Table.ProvisionedThroughput.LastIncreaseDateTime", "$..Table.Replicas", + "$..Table.WarmThroughput", ] ) def test_global_table(deploy_cfn_template, snapshot, aws_client, region_name): diff --git c/tests/aws/services/es/resources/test_elasticsearch.py i/tests/aws/services/es/resources/test_elasticsearch.py index e88424f..6cadf02 100644 --- c/tests/aws/services/es/resources/test_elasticsearch.py +++ i/tests/aws/services/es/resources/test_elasticsearch.py @@ -17,6 +17,8 @@ from localstack.utils.strings import short_uid "$..DomainStatus.ElasticsearchClusterConfig.InstanceCount", "$..DomainStatus.ElasticsearchClusterConfig.ZoneAwarenessConfig", "$..DomainStatus.ElasticsearchClusterConfig.ZoneAwarenessEnabled", + "$..DomainStatus.ElasticsearchClusterConfig.DedicatedMasterType", + "$..DomainStatus.ElasticsearchClusterConfig.InstanceType", "$..DomainStatus.Endpoint", "$..DomainStatus.ModifyingProperties", "$..DomainStatus.Processing", diff --git c/tests/aws/services/lambda_/resources/test_lambda.py i/tests/aws/services/lambda_/resources/test_lambda.py index f404897..265fc5f 100644 --- c/tests/aws/services/lambda_/resources/test_lambda.py +++ i/tests/aws/services/lambda_/resources/test_lambda.py @@ -656,6 +656,7 @@ class TestCfnLambdaIntegrations: "$..CodeSize", "$..Configuration.Layers", "$..Tags", # missing cloudformation automatic resource tags for the lambda function + "$..RevisionId", ] ) @markers.aws.validated @@ -890,6 +891,7 @@ class TestCfnLambdaIntegrations: "$..Table.Replicas", # stream result "$..StreamDescription.CreationRequestDateTime", + "$..Table.WarmThroughput", ] ) @markers.aws.validated diff --git c/tests/aws/services/opensearch/resources/test_opensearch.py i/tests/aws/services/opensearch/resources/test_opensearch.py index 152e574..bc57887 100644 --- c/tests/aws/services/opensearch/resources/test_opensearch.py +++ i/tests/aws/services/opensearch/resources/test_opensearch.py @@ -70,6 +70,14 @@ def test_domain(deploy_cfn_template, aws_client, snapshot): "$..DomainStatus.OffPeakWindowOptions", "$..DomainStatus.ServiceSoftwareOptions.CurrentVersion", "$..DomainStatus.SoftwareUpdateOptions", + "$..DomainStatus.AIMLOptions", + "$..DomainStatus.ClusterConfig.DedicatedMasterType", + "$..DomainStatus.ClusterConfig.InstanceType", + "$..DomainStatus.DomainEndpointOptions.TLSSecurityPolicy", + "$..DomainStatus.DomainProcessingStatus", + "$..DomainStatus.IPAddressType", + "$..DomainStatus.IdentityCenterOptions", + "$..DomainStatus.ModifyingProperties", ] ) def test_domain_with_alternative_types(deploy_cfn_template, aws_client, snapshot): diff --git c/tests/aws/services/s3/resources/test_s3.py i/tests/aws/services/s3/resources/test_s3.py index a237479..88be10f 100644 --- c/tests/aws/services/s3/resources/test_s3.py +++ i/tests/aws/services/s3/resources/test_s3.py @@ -86,6 +86,7 @@ def test_website_configuration(deploy_cfn_template, snapshot, aws_client): @markers.aws.validated +@markers.snapshot.skip_snapshot_verify(paths=["$..CORSRules..MaxAgeSeconds"]) def test_cors_configuration(deploy_cfn_template, snapshot, aws_client): snapshot.add_transformer(snapshot.transform.cloudformation_api()) snapshot.add_transformer(snapshot.transform.s3_api()) diff --git c/tests/aws/services/sns/resources/test_sns.py i/tests/aws/services/sns/resources/test_sns.py index 340804f..8bc36ef 100644 --- c/tests/aws/services/sns/resources/test_sns.py +++ i/tests/aws/services/sns/resources/test_sns.py @@ -105,6 +105,7 @@ def test_deploy_stack_with_sns_topic(deploy_cfn_template, aws_client): @markers.aws.validated +@markers.snapshot.skip_snapshot_verify(paths=["$..Attributes.SubscriptionPrincipal"]) def test_update_subscription(snapshot, deploy_cfn_template, aws_client, sqs_queue, sns_topic): topic_arn = sns_topic["Attributes"]["TopicArn"] queue_url = sqs_queue
1 parent 15b96fe commit 9cf3a84

File tree

9 files changed

+134
-0
lines changed

9 files changed

+134
-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
@@ -306,6 +306,7 @@ def test_cfn_deploy_apigateway_models(deploy_cfn_template, snapshot, aws_client)
306306

307307

308308
@markers.aws.validated
309+
@markers.snapshot.skip_snapshot_verify(paths=["$..endpointConfiguration.ipAddressType"])
309310
def test_cfn_deploy_apigateway_integration(deploy_cfn_template, snapshot, aws_client):
310311
snapshot.add_transformer(snapshot.transform.key_value("cacheNamespace"))
311312

@@ -340,6 +341,7 @@ def test_cfn_deploy_apigateway_integration(deploy_cfn_template, snapshot, aws_cl
340341
# TODO: missing from LS response
341342
"$.get-stage.methodSettings",
342343
"$.get-stage.tags",
344+
"$..endpointConfiguration.ipAddressType",
343345
]
344346
)
345347
def test_cfn_deploy_apigateway_from_s3_swagger(
@@ -538,6 +540,7 @@ def test_update_apigateway_stage(deploy_cfn_template, snapshot, aws_client):
538540

539541

540542
@markers.aws.validated
543+
@markers.snapshot.skip_snapshot_verify(paths=["$..endpointConfiguration.ipAddressType"])
541544
def test_api_gateway_with_policy_as_dict(deploy_cfn_template, snapshot, aws_client):
542545
template = """
543546
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/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
@@ -656,6 +656,7 @@ class TestCfnLambdaIntegrations:
656656
"$..CodeSize",
657657
"$..Configuration.Layers",
658658
"$..Tags", # missing cloudformation automatic resource tags for the lambda function
659+
"$..RevisionId",
659660
]
660661
)
661662
@markers.aws.validated
@@ -890,6 +891,7 @@ def _send_events():
890891
"$..Table.Replicas",
891892
# stream result
892893
"$..StreamDescription.CreationRequestDateTime",
894+
"$..Table.WarmThroughput",
893895
]
894896
)
895897
@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
@@ -70,6 +70,14 @@ def test_domain(deploy_cfn_template, aws_client, snapshot):
7070
"$..DomainStatus.OffPeakWindowOptions",
7171
"$..DomainStatus.ServiceSoftwareOptions.CurrentVersion",
7272
"$..DomainStatus.SoftwareUpdateOptions",
73+
"$..DomainStatus.AIMLOptions",
74+
"$..DomainStatus.ClusterConfig.DedicatedMasterType",
75+
"$..DomainStatus.ClusterConfig.InstanceType",
76+
"$..DomainStatus.DomainEndpointOptions.TLSSecurityPolicy",
77+
"$..DomainStatus.DomainProcessingStatus",
78+
"$..DomainStatus.IPAddressType",
79+
"$..DomainStatus.IdentityCenterOptions",
80+
"$..DomainStatus.ModifyingProperties",
7381
]
7482
)
7583
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
@@ -105,6 +105,7 @@ def test_deploy_stack_with_sns_topic(deploy_cfn_template, aws_client):
105105

106106

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

0 commit comments

Comments
 (0)