Skip to content

Commit

Permalink
chore(tests): Fixed tests that relied on required properties
Browse files Browse the repository at this point in the history
We had some tests that relied on the fact that AWS::Route53::HostedZone
had a required property of 'Name'. This recently changed and the Name
property is no longer marked as required in the CFN schema, so tests
failed.

Searched for resources that had a single required property and picked
one at random (AWS::IoT::Policy). Tests passing now.
  • Loading branch information
PaulMaddox committed Nov 22, 2021
1 parent 36cc848 commit 056535a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
31 changes: 15 additions & 16 deletions test/json/invalid-template-empty-resource-properties.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Has empty properties for AWS::Route53::HostedZone (Name is required)",
"Resources" : {
"MyRoute53HostedZone" : {
"Type" : "AWS::Route53::HostedZone",
"Properties" : {
}
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Has empty properties for AWS::IoT::Policy (PolicyDocument is required)",
"Resources": {
"MyRoute53HostedZone": {
"Type": "AWS::IoT::Policy",
"Properties": {}
},
"MySNSTopic" : {
"Type" : "AWS::SNS::Topic",
"Properties" : {
"DisplayName" : "test-sns-topic-display-name",
"Subscription" : [
"MySNSTopic": {
"Type": "AWS::SNS::Topic",
"Properties": {
"DisplayName": "test-sns-topic-display-name",
"Subscription": [
{
"Endpoint" : "test-sns-topic-subscription-endpoint",
"Protocol" : "test-sns-topic-subscription-protocol"
"Endpoint": "test-sns-topic-subscription-endpoint",
"Protocol": "test-sns-topic-subscription-protocol"
}
],
"TopicName" : "test-sns-topic-name"
"TopicName": "test-sns-topic-name"
}
}
}
}
}
28 changes: 14 additions & 14 deletions test/json/invalid-template-missing-resource-properties.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Missing Properties for AWS::Route53::HostedZone (Name is required)",
"Resources" : {
"MyRoute53HostedZone" : {
"Type" : "AWS::Route53::HostedZone"
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Missing Properties for AWS::IoT::Policy (PolicyDocument is required)",
"Resources": {
"MyIoTPolicy": {
"Type": "AWS::IoT::Policy"
},
"MySNSTopic" : {
"Type" : "AWS::SNS::Topic",
"Properties" : {
"DisplayName" : "test-sns-topic-display-name",
"Subscription" : [
"MySNSTopic": {
"Type": "AWS::SNS::Topic",
"Properties": {
"DisplayName": "test-sns-topic-display-name",
"Subscription": [
{
"Endpoint" : "test-sns-topic-subscription-endpoint",
"Protocol" : "test-sns-topic-subscription-protocol"
"Endpoint": "test-sns-topic-subscription-endpoint",
"Protocol": "test-sns-topic-subscription-protocol"
}
],
"TopicName" : "test-sns-topic-name"
"TopicName": "test-sns-topic-name"
}
}
}
}
}

0 comments on commit 056535a

Please sign in to comment.