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

service/rds: Update acceptance tests to use ARN testing check functions #13098

Merged
merged 3 commits into from
Apr 30, 2020

Conversation

gdavison
Copy link
Contributor

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 #11888

Release note for CHANGELOG:

NONE

Previously:

aws/resource_aws_db_cluster_snapshot_test.go:31:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
aws/resource_aws_db_event_subscription_test.go:31:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
aws/resource_aws_db_parameter_group_test.go:107:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
aws/resource_aws_db_parameter_group_test.go:145:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
aws/resource_aws_db_security_group_test.go:36:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
aws/resource_aws_db_subnet_group_test.go:91:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
aws/resource_aws_rds_cluster_parameter_group_test.go:101:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
aws/resource_aws_rds_cluster_parameter_group_test.go:194:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
aws/resource_aws_rds_cluster_test.go:117:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)

Output from acceptance testing:

--- PASS: TestAccAWSDBParameterGroup_Disappears (11.08s)
--- PASS: TestAccAWSDBSecurityGroup_basic (35.35s)
--- PASS: TestAccAWSDBParameterGroup_namePrefix (26.89s)
--- PASS: TestAccAWSDBParameterGroup_withApplyMethod (31.58s)
--- PASS: TestAccAWSDBParameterGroup_MatchDefault (32.22s)
--- PASS: TestAccAWSDBParameterGroup_generatedName (34.56s)
--- PASS: TestAccAWSDBSubnetGroup_generatedName (53.08s)
--- PASS: TestAccAWSDBParameterGroup_Only (54.63s)
--- PASS: TestAccAWSDBClusterParameterGroup_generatedName (22.43s)
--- PASS: TestAccAWSDBSubnetGroup_updateDescription (48.06s)
--- PASS: TestAccAWSDBParameterGroup_basic (59.63s)
--- PASS: TestAccAWSDBClusterParameterGroup_disappears (7.42s)
--- PASS: TestAccAWSDBClusterParameterGroup_generatedName_Parameter (9.09s)
--- PASS: TestAccAWSDBSubnetGroup_namePrefix (63.18s)
--- PASS: TestAccAWSDBClusterParameterGroup_namePrefix (43.46s)
--- PASS: TestAccAWSDBEventSubscription_withPrefix (77.61s)
--- PASS: TestAccAWSDBClusterParameterGroup_only (22.80s)
--- PASS: TestAccAWSDBEventSubscription_disappears (85.61s)
--- PASS: TestAccAWSRDSCluster_missingUserNameCausesError (3.42s)
--- PASS: TestAccAWSDBClusterParameterGroup_withApplyMethod (68.62s)
--- PASS: TestAccAWSDBClusterParameterGroup_namePrefix_Parameter (69.33s)
--- PASS: TestAccAWSDBClusterParameterGroup_basic (89.78s)
--- PASS: TestAccAWSDBParameterGroup_limit (109.74s)
--- PASS: TestAccAWSDBSubnetGroup_withUndocumentedCharacters (121.01s)
--- PASS: TestAccAWSDBSubnetGroup_basic (122.58s)
--- PASS: TestAccAWSDBEventSubscription_basicUpdate (129.53s)
--- PASS: TestAccAWSDBEventSubscription_withSourceIds (133.72s)
--- PASS: TestAccAWSDBClusterSnapshot_basic (152.30s)
--- PASS: TestAccAWSDBEventSubscription_categoryUpdate (164.20s)
--- PASS: TestAccAWSRDSCluster_basic (112.91s)
--- PASS: TestAccAWSRDSCluster_generatedName (102.21s)
--- PASS: TestAccAWSRDSCluster_AvailabilityZones (137.40s)
--- PASS: TestAccAWSRDSCluster_ClusterIdentifierPrefix (152.61s)
--- PASS: TestAccAWSRDSCluster_Tags (126.67s)
--- PASS: TestAccAWSDBClusterSnapshot_Tags (217.04s)
--- PASS: TestAccAWSRDSCluster_updateIamRoles (117.47s)
--- PASS: TestAccAWSRDSCluster_BacktrackWindow (158.75s)
--- PASS: TestAccAWSRDSCluster_takeFinalSnapshot (140.99s)
--- PASS: TestAccAWSRDSCluster_kmsKey (128.90s)
--- PASS: TestAccAWSRDSCluster_encrypted (124.84s)
--- PASS: TestAccAWSRDSCluster_iamAuth (109.76s)
--- PASS: TestAccAWSRDSCluster_DbSubnetGroupName (179.74s)
--- PASS: TestAccAWSRDSCluster_EngineMode_Global (129.93s)
--- PASS: TestAccAWSRDSCluster_EngineMode_Multimaster (123.73s)
--- PASS: TestAccAWSRDSCluster_backupsUpdate (175.81s)
--- PASS: TestAccAWSRDSCluster_copyTagsToSnapshot (184.71s)
--- SKIP: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_Serverless (0.00s)
--- PASS: TestAccAWSRDSCluster_DeletionProtection (165.81s)
--- PASS: TestAccAWSRDSCluster_EngineMode_ParallelQuery (139.61s)
--- PASS: TestAccAWSRDSCluster_EngineVersion (122.40s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Update (117.23s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Remove (119.07s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global (124.70s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Add (124.27s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Provisioned (134.45s)
--- PASS: TestAccAWSRDSCluster_EnabledCloudwatchLogsExports (308.47s)
--- PASS: TestAccAWSRDSCluster_Port (256.83s)
--- PASS: TestAccAWSRDSCluster_EngineMode (389.86s)
--- PASS: TestAccAWSRDSCluster_ScalingConfiguration (328.03s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier (378.84s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Different (331.25s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_Provisioned (348.17s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Equal (338.09s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_MasterUsername (338.59s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_PreferredBackupWindow (338.26s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_DeletionProtection (374.67s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_PreferredMaintenanceWindow (338.47s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds (349.55s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_Tags (358.83s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds_Tags (349.85s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_MasterPassword (378.67s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EncryptedRestore (358.29s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_ParallelQuery (479.55s)
--- PASS: TestAccAWSRDSCluster_EnableHttpEndpoint (369.82s)
--- PASS: TestAccAWSRDSCluster_EngineVersionWithPrimaryInstance (1066.48s)
--- FAIL: TestAccAWSRDSCluster_s3Restore (1546.47s)
--- PASS: TestAccAWSRDSCluster_EncryptedCrossRegionReplication (1649.47s)

TestAccAWSRDSCluster_s3Restore is a pre-existing failure

…esting check functions

Addresses:
aws/resource_aws_rds_cluster_parameter_group_test.go:101:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
aws/resource_aws_rds_cluster_parameter_group_test.go:194:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
…ctions

Addresses:
aws/resource_aws_rds_cluster_test.go:117:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
@gdavison gdavison requested a review from a team April 30, 2020 01:26
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/rds Issues and PRs that pertain to the rds service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 30, 2020
@bflad bflad added technical-debt Addresses areas of the codebase that need refactoring or redesign. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 30, 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.

Looks good 🚀 I'll submit a followup to add testAccEC2ClassicPreCheck(t) to TestAccAWSDBSecurityGroup_basic since it requires EC2-Classic (which is not available in the alternate testing account).

Output from acceptance testing:

--- FAIL: TestAccAWSDBSecurityGroup_basic (12.40s)
--- FAIL: TestAccAWSRDSCluster_s3Restore (1562.09s)

--- PASS: TestAccAWSDBClusterParameterGroup_basic (19.55s)
--- PASS: TestAccAWSDBClusterParameterGroup_disappears (6.93s)
--- PASS: TestAccAWSDBClusterParameterGroup_generatedName (8.58s)
--- PASS: TestAccAWSDBClusterParameterGroup_generatedName_Parameter (9.04s)
--- PASS: TestAccAWSDBClusterParameterGroup_namePrefix (8.62s)
--- PASS: TestAccAWSDBClusterParameterGroup_namePrefix_Parameter (8.47s)
--- PASS: TestAccAWSDBClusterParameterGroup_only (8.31s)
--- PASS: TestAccAWSDBClusterParameterGroup_withApplyMethod (8.65s)

--- PASS: TestAccAWSDBClusterSnapshot_basic (125.76s)
--- PASS: TestAccAWSDBClusterSnapshot_Tags (152.01s)

--- PASS: TestAccAWSDBEventSubscription_basicUpdate (118.93s)
--- PASS: TestAccAWSDBEventSubscription_categoryUpdate (112.37s)
--- PASS: TestAccAWSDBEventSubscription_disappears (73.74s)
--- PASS: TestAccAWSDBEventSubscription_withPrefix (93.34s)
--- PASS: TestAccAWSDBEventSubscription_withSourceIds (95.24s)

--- PASS: TestAccAWSDBParameterGroup_basic (53.34s)
--- PASS: TestAccAWSDBParameterGroup_Disappears (10.91s)
--- PASS: TestAccAWSDBParameterGroup_generatedName (12.47s)
--- PASS: TestAccAWSDBParameterGroup_limit (59.11s)
--- PASS: TestAccAWSDBParameterGroup_MatchDefault (15.87s)
--- PASS: TestAccAWSDBParameterGroup_namePrefix (12.66s)
--- PASS: TestAccAWSDBParameterGroup_Only (14.31s)
--- PASS: TestAccAWSDBParameterGroup_withApplyMethod (13.45s)

--- PASS: TestAccAWSDBSubnetGroup_basic (35.64s)
--- PASS: TestAccAWSDBSubnetGroup_generatedName (16.71s)
--- PASS: TestAccAWSDBSubnetGroup_namePrefix (19.49s)
--- PASS: TestAccAWSDBSubnetGroup_updateDescription (47.25s)
--- PASS: TestAccAWSDBSubnetGroup_withUndocumentedCharacters (21.93s)

--- PASS: TestAccAWSRDSCluster_AvailabilityZones (131.06s)
--- PASS: TestAccAWSRDSCluster_BacktrackWindow (166.79s)
--- PASS: TestAccAWSRDSCluster_backupsUpdate (146.12s)
--- PASS: TestAccAWSRDSCluster_basic (119.84s)
--- PASS: TestAccAWSRDSCluster_ClusterIdentifierPrefix (119.79s)
--- PASS: TestAccAWSRDSCluster_copyTagsToSnapshot (222.39s)
--- PASS: TestAccAWSRDSCluster_DbSubnetGroupName (114.73s)
--- PASS: TestAccAWSRDSCluster_DeletionProtection (146.11s)
--- PASS: TestAccAWSRDSCluster_EnabledCloudwatchLogsExports (359.35s)
--- PASS: TestAccAWSRDSCluster_EnableHttpEndpoint (358.94s)
--- PASS: TestAccAWSRDSCluster_encrypted (130.39s)
--- PASS: TestAccAWSRDSCluster_EncryptedCrossRegionReplication (1639.24s)
--- PASS: TestAccAWSRDSCluster_EngineMode (401.97s)
--- PASS: TestAccAWSRDSCluster_EngineMode_Global (120.06s)
--- PASS: TestAccAWSRDSCluster_EngineMode_Multimaster (123.94s)
--- PASS: TestAccAWSRDSCluster_EngineMode_ParallelQuery (150.58s)
--- PASS: TestAccAWSRDSCluster_EngineVersion (132.90s)
--- PASS: TestAccAWSRDSCluster_EngineVersionWithPrimaryInstance (1087.72s)
--- PASS: TestAccAWSRDSCluster_generatedName (120.10s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global (124.89s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Add (115.99s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Remove (130.48s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Update (127.67s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Provisioned (124.95s)
--- PASS: TestAccAWSRDSCluster_iamAuth (130.30s)
--- PASS: TestAccAWSRDSCluster_kmsKey (131.64s)
--- PASS: TestAccAWSRDSCluster_missingUserNameCausesError (3.54s)
--- PASS: TestAccAWSRDSCluster_Port (227.21s)
--- PASS: TestAccAWSRDSCluster_ScalingConfiguration (339.74s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier (338.80s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_DeletionProtection (375.42s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EncryptedRestore (339.31s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_ParallelQuery (479.26s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_Provisioned (399.23s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Different (378.91s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Equal (400.11s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_MasterPassword (339.63s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_MasterUsername (338.27s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_PreferredBackupWindow (379.25s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_PreferredMaintenanceWindow (358.73s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_Tags (349.33s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds (330.13s)
--- PASS: TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds_Tags (329.85s)
--- PASS: TestAccAWSRDSCluster_Tags (152.25s)
--- PASS: TestAccAWSRDSCluster_takeFinalSnapshot (180.80s)
--- PASS: TestAccAWSRDSCluster_updateIamRoles (147.24s)

--- PASS: TestAccAWSRDSClusterEndpoint_basic (1051.82s)
--- PASS: TestAccAWSRDSClusterEndpoint_tags (1117.53s)

--- PASS: TestAccAWSRDSClusterInstance_az (781.17s)
--- PASS: TestAccAWSRDSClusterInstance_basic (1498.16s)
--- PASS: TestAccAWSRDSClusterInstance_CACertificateIdentifier (606.87s)
--- PASS: TestAccAWSRDSClusterInstance_CopyTagsToSnapshot (673.26s)
--- PASS: TestAccAWSRDSClusterInstance_disappears (702.63s)
--- PASS: TestAccAWSRDSClusterInstance_generatedName (594.94s)
--- PASS: TestAccAWSRDSClusterInstance_isAlreadyBeingDeleted (742.48s)
--- PASS: TestAccAWSRDSClusterInstance_kmsKey (1306.74s)
--- PASS: TestAccAWSRDSClusterInstance_MonitoringInterval (1350.08s)
--- PASS: TestAccAWSRDSClusterInstance_MonitoringRoleArn_EnabledToDisabled (940.91s)
--- PASS: TestAccAWSRDSClusterInstance_MonitoringRoleArn_EnabledToRemoved (888.14s)
--- PASS: TestAccAWSRDSClusterInstance_MonitoringRoleArn_RemovedToEnabled (784.69s)
--- PASS: TestAccAWSRDSClusterInstance_namePrefix (673.23s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsEnabled_AuroraMysql1 (769.32s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsEnabled_AuroraMysql2 (748.54s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsEnabled_AuroraPostgresql (738.31s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql1 (760.74s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql1_DefaultKeyToCustomKey (802.98s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql2 (809.40s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql2_DefaultKeyToCustomKey (813.45s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraPostgresql (748.42s)
--- PASS: TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraPostgresql_DefaultKeyToCustomKey (762.61s)
--- PASS: TestAccAWSRDSClusterInstance_PubliclyAccessible (746.00s)

Comment on lines -71 to -73
testCheck := func(*terraform.State) error {
return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that was … interesting

"aws_db_subnet_group.spaces", &v),
testAccCheckDBSubnetGroupExists("aws_db_subnet_group.underscores", &v),
testAccCheckDBSubnetGroupExists("aws_db_subnet_group.periods", &v),
testAccCheckDBSubnetGroupExists("aws_db_subnet_group.spaces", &v),
testCheck,
Copy link
Contributor

Choose a reason for hiding this comment

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

Haha here's another empty one 🙃

@gdavison gdavison merged commit ea1a56a into master Apr 30, 2020
@gdavison gdavison deleted the t-clean-up-rds-arn-tests branch April 30, 2020 20:02
@gdavison gdavison added this to the v2.60.0 milestone Apr 30, 2020
@ghost
Copy link

ghost commented May 1, 2020

This has been released in version 2.60.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 May 31, 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 May 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/rds Issues and PRs that pertain to the rds service. size/XL Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. 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.

2 participants