Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to check TypeSet pairs #14279

Merged
merged 2 commits into from
Jul 22, 2020
Merged

Conversation

YakDriver
Copy link
Member

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #12994

Release note for CHANGELOG:

NONE

The output from acceptance testing.

This modifies tfawsresource.TestCheckTypeSetElemAttr() so that the new function, tfawsresource.TestCheckTypeSetElemAttrPair(), can share its guts. As such, I ran some general acc tests that show is tfawsresource.TestCheckTypeSetElemAttr() is still working.

This uses the new function tfawsresource.TestCheckTypeSetElemAttrPair():

% testacc TestAccAWSAutoScalingGroup_basic
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAutoScalingGroup_basic -timeout 120m
=== RUN   TestAccAWSAutoScalingGroup_basic
=== PAUSE TestAccAWSAutoScalingGroup_basic
=== CONT  TestAccAWSAutoScalingGroup_basic
--- PASS: TestAccAWSAutoScalingGroup_basic (342.50s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	342.549s

This uses the new function tfawsresource.TestCheckTypeSetElemAttrPair():

% testacc TestAccAWSAutoScalingGroup_VpcUpdates
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAutoScalingGroup_VpcUpdates -timeout 120m
=== RUN   TestAccAWSAutoScalingGroup_VpcUpdates
=== PAUSE TestAccAWSAutoScalingGroup_VpcUpdates
=== CONT  TestAccAWSAutoScalingGroup_VpcUpdates
--- PASS: TestAccAWSAutoScalingGroup_VpcUpdates (73.10s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	73.148s

This uses the existing and modified function tfawsresource.TestCheckTypeSetElemAttr():

% testacc TestAccAWSAutoScalingGroup_basic
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAutoScalingGroup_basic -timeout 120m
=== RUN   TestAccAWSAutoScalingGroup_basic
=== PAUSE TestAccAWSAutoScalingGroup_basic
=== CONT  TestAccAWSAutoScalingGroup_basic
--- PASS: TestAccAWSAutoScalingGroup_basic (342.50s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	342.549s

This uses the existing and modified function tfawsresource.TestCheckTypeSetElemAttr():

% testacc TestAccAwsWafv2IPSet_IPv6
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsWafv2IPSet_IPv6 -timeout 120m
=== RUN   TestAccAwsWafv2IPSet_IPv6
=== PAUSE TestAccAwsWafv2IPSet_IPv6
=== CONT  TestAccAwsWafv2IPSet_IPv6
--- PASS: TestAccAwsWafv2IPSet_IPv6 (12.33s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	12.386s

@YakDriver YakDriver requested a review from a team July 21, 2020 17:37
@ghost ghost added size/L Managed by automation to categorize the size of a PR. service/autoscaling Issues and PRs that pertain to the autoscaling service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 21, 2020
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Jul 21, 2020
Copy link
Contributor

@appilon appilon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some unit tests for the attrpair would be good, I will move this to the SDK one day.

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Jul 21, 2020
@YakDriver
Copy link
Member Author

@appilon I added 11 unit tests. Let me know what you think.

@bflad bflad added this to the v3.0.0 milestone Jul 22, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Output from acceptance testing:

--- PASS: TestAccAWSAutoScalingGroup_ALB_TargetGroups (257.03s)
--- PASS: TestAccAWSAutoScalingGroup_ALB_TargetGroups_ELBCapacity (314.35s)
--- PASS: TestAccAWSAutoScalingGroup_autoGeneratedName (89.99s)
--- PASS: TestAccAWSAutoScalingGroup_basic (256.43s)
--- PASS: TestAccAWSAutoScalingGroup_classicVpcZoneIdentifier (48.60s)
--- PASS: TestAccAWSAutoScalingGroup_enablingMetrics (199.42s)
--- PASS: TestAccAWSAutoScalingGroup_initialLifecycleHook (262.42s)
--- PASS: TestAccAWSAutoScalingGroup_launchTemplate (73.17s)
--- PASS: TestAccAWSAutoScalingGroup_LaunchTemplate_IAMInstanceProfile (98.77s)
--- PASS: TestAccAWSAutoScalingGroup_launchTemplate_update (290.95s)
--- PASS: TestAccAWSAutoScalingGroup_launchTempPartitionNum (103.96s)
--- PASS: TestAccAWSAutoScalingGroup_LoadBalancers (629.95s)
--- PASS: TestAccAWSAutoScalingGroup_MaxInstanceLifetime (80.72s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy (43.74s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandAllocationStrategy (47.68s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandBaseCapacity (49.49s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandPercentageAboveBaseCapacity (45.64s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotAllocationStrategy (54.50s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotInstancePools (79.92s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotMaxPrice (72.78s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_UpdateToZeroOnDemandBaseCapacity (76.11s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_LaunchTemplateName (111.53s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_Version (70.64s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType (51.86s)
--- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_WeightedCapacity (133.24s)
--- PASS: TestAccAWSAutoScalingGroup_namePrefix (86.69s)
--- PASS: TestAccAWSAutoScalingGroup_serviceLinkedRoleARN (51.56s)
--- PASS: TestAccAWSAutoScalingGroup_suspendingProcesses (353.84s)
--- PASS: TestAccAWSAutoScalingGroup_tags (297.87s)
--- PASS: TestAccAWSAutoScalingGroup_TargetGroupArns (330.61s)
--- PASS: TestAccAWSAutoScalingGroup_terminationPolicies (116.97s)
--- PASS: TestAccAWSAutoScalingGroup_VpcUpdates (123.02s)
--- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer (372.31s)
--- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup (500.75s)
--- PASS: TestAccAWSAutoScalingGroup_withMetrics (84.61s)
--- PASS: TestAccAWSAutoScalingGroup_withPlacementGroup (132.72s)

@YakDriver YakDriver merged commit 05eb14a into hashicorp:master Jul 22, 2020
@YakDriver YakDriver deleted the typepaircheck branch July 22, 2020 15:44
@YakDriver
Copy link
Member Author

🥳

@ghost
Copy link

ghost commented Jul 31, 2020

This has been released in version 3.0.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Aug 21, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Aug 21, 2020
@YakDriver YakDriver added the partition/aws-us-gov Pertains to the aws-us-gov partition. label Aug 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
partition/aws-us-gov Pertains to the aws-us-gov partition. service/autoscaling Issues and PRs that pertain to the autoscaling service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants