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

Import test refactor for elasticache resources #10160

Merged
merged 4 commits into from
Oct 29, 2019
Merged

Conversation

ryndaniels
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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Relates #8944

Release note for CHANGELOG:

NONE

Output from acceptance testing:

$ make testacc TESTARGS="-run=TestAccAWSElasticacheSubnetGroup_"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSElasticacheSubnetGroup_ -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSElasticacheSubnetGroup_basic
=== PAUSE TestAccAWSElasticacheSubnetGroup_basic
=== RUN   TestAccAWSElasticacheSubnetGroup_update
=== PAUSE TestAccAWSElasticacheSubnetGroup_update
=== CONT  TestAccAWSElasticacheSubnetGroup_basic
=== CONT  TestAccAWSElasticacheSubnetGroup_update
--- PASS: TestAccAWSElasticacheSubnetGroup_basic (60.82s)
--- PASS: TestAccAWSElasticacheSubnetGroup_update (100.57s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       101.693s

 make testacc TESTARGS="-run=TestAccAWSElasticacheSecurityGroup_" ==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSElasticacheSecurityGroup_ -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSElasticacheSecurityGroup_basic
=== PAUSE TestAccAWSElasticacheSecurityGroup_basic
=== CONT  TestAccAWSElasticacheSecurityGroup_basic
--- PASS: TestAccAWSElasticacheSecurityGroup_basic (30.65s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       32.110s

make testacc TESTARGS="-run=TestAccAWSElasticacheReplicationGroup_"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSElasticacheReplicationGroup_ -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSElasticacheReplicationGroup_basic
=== PAUSE TestAccAWSElasticacheReplicationGroup_basic
=== RUN   TestAccAWSElasticacheReplicationGroup_Uppercase
=== PAUSE TestAccAWSElasticacheReplicationGroup_Uppercase
=== RUN   TestAccAWSElasticacheReplicationGroup_updateDescription
=== PAUSE TestAccAWSElasticacheReplicationGroup_updateDescription
=== RUN   TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow
=== PAUSE TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow
=== RUN   TestAccAWSElasticacheReplicationGroup_updateNodeSize
=== PAUSE TestAccAWSElasticacheReplicationGroup_updateNodeSize
=== RUN   TestAccAWSElasticacheReplicationGroup_updateParameterGroup
=== PAUSE TestAccAWSElasticacheReplicationGroup_updateParameterGroup
=== RUN   TestAccAWSElasticacheReplicationGroup_vpc
=== PAUSE TestAccAWSElasticacheReplicationGroup_vpc
=== RUN   TestAccAWSElasticacheReplicationGroup_multiAzInVpc
=== PAUSE TestAccAWSElasticacheReplicationGroup_multiAzInVpc
=== RUN   TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2
=== PAUSE TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2
=== RUN   TestAccAWSElasticacheReplicationGroup_ClusterMode_Basic
=== PAUSE TestAccAWSElasticacheReplicationGroup_ClusterMode_Basic
=== RUN   TestAccAWSElasticacheReplicationGroup_ClusterMode_NumNodeGroups
=== PAUSE TestAccAWSElasticacheReplicationGroup_ClusterMode_NumNodeGroups
=== RUN   TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError
=== PAUSE TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError
=== RUN   TestAccAWSElasticacheReplicationGroup_enableSnapshotting
=== PAUSE TestAccAWSElasticacheReplicationGroup_enableSnapshotting
=== RUN   TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption
=== PAUSE TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption
=== RUN   TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption
=== PAUSE TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption
=== RUN   TestAccAWSElasticacheReplicationGroup_NumberCacheClusters
=== PAUSE TestAccAWSElasticacheReplicationGroup_NumberCacheClusters
=== RUN   TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverDisabled
=== PAUSE TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverDisabled
=== RUN   TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverEnabled
=== PAUSE TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverEnabled
=== CONT  TestAccAWSElasticacheReplicationGroup_basic
=== CONT  TestAccAWSElasticacheReplicationGroup_ClusterMode_Basic
=== CONT  TestAccAWSElasticacheReplicationGroup_updateParameterGroup
=== CONT  TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError
=== CONT  TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverDisabled
=== CONT  TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverEnabled
=== CONT  TestAccAWSElasticacheReplicationGroup_ClusterMode_NumNodeGroups
=== CONT  TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2
=== CONT  TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption
=== CONT  TestAccAWSElasticacheReplicationGroup_NumberCacheClusters
=== CONT  TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption
=== CONT  TestAccAWSElasticacheReplicationGroup_enableSnapshotting
=== CONT  TestAccAWSElasticacheReplicationGroup_vpc
=== CONT  TestAccAWSElasticacheReplicationGroup_multiAzInVpc
=== CONT  TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow
=== CONT  TestAccAWSElasticacheReplicationGroup_updateDescription
=== CONT  TestAccAWSElasticacheReplicationGroup_Uppercase
=== CONT  TestAccAWSElasticacheReplicationGroup_updateNodeSize
--- PASS: TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError (34.95s)
--- PASS: TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption (768.76s)
--- PASS: TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption (830.76s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateParameterGroup (942.71s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverDisabled (1198.03s)
--- PASS: TestAccAWSElasticacheReplicationGroup_Uppercase (1214.21s)
--- PASS: TestAccAWSElasticacheReplicationGroup_enableSnapshotting (1326.27s)
--- PASS: TestAccAWSElasticacheReplicationGroup_vpc (1326.94s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateDescription (1524.49s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateNodeSize (1654.44s)
--- PASS: TestAccAWSElasticacheReplicationGroup_basic (1813.96s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_Basic (1823.14s)
--- PASS: TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2 (1888.82s)
--- PASS: TestAccAWSElasticacheReplicationGroup_multiAzInVpc (2043.80s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow (2337.05s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters (2521.89s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverEnabled (3155.02s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_NumNodeGroups (3831.39s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       3832.449s

@ryndaniels ryndaniels requested a review from a team September 19, 2019 11:48
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. service/elasticache Issues and PRs that pertain to the elasticache service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Sep 19, 2019
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.

This should be good to go if we remove all the new AWS_DEFAULT_REGION handing (let's treat that as a separate project) 👍

},
})
}

func TestAccAWSElasticacheReplicationGroup_Uppercase(t *testing.T) {
oldvar := os.Getenv("AWS_DEFAULT_REGION")
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's omit these AWS_DEFAULT_REGION handling changes for now here and below until we have a full plan for fixing the hardcoded EC2-Classic/us-east-1 testing 👍 They should all pass individually locally (or concurrently in TeamCity) and I think we should avoid introducing this style into existing tests if avoidable.

@ghost
Copy link

ghost commented Oct 16, 2019

Hello, and thank you for your contribution!

This project recently migrated to the standalone Terraform Plugin SDK. While the migration helps speed up future feature requests and bug fixes to the Terraform AWS Provider's interface with Terraform, it has the unfortunate consequence of requiring minor changes to pull requests created using the old SDK.

This pull request appears to include the Go import path "github.com/hashicorp/terraform/helper/acctest", which was from the older SDK. The newer SDK uses import paths beginning with github.com/hashicorp/terraform-plugin-sdk/.

To resolve this situation without losing any existing work, you may be able to Git rebase your branch against the current master branch (example below); replacing any remaining old import paths with the newer ones.

$ git fetch --all
$ git rebase origin/master

Another option is to create a new branch from the current master with the same code changes (replacing the import paths), submit a new pull request, and close this existing pull request.

We apologize for this inconvenience and appreciate your effort. Thank you for contributing and helping make the Terraform AWS Provider better for everyone.

@ghost ghost added terraform-plugin-sdk-migration waiting-response Maintainers are waiting on response from community or contributor. and removed waiting-response Maintainers are waiting on response from community or contributor. labels Oct 16, 2019
@ryndaniels ryndaniels force-pushed the rfd-at002-elasticache branch from 95aa171 to 3773ed5 Compare October 21, 2019 06:11
@ryndaniels ryndaniels requested a review from bflad October 21, 2019 09:10
@bflad bflad self-assigned this Oct 25, 2019
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 with two optional nits

--- PASS: TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError (15.98s)
--- PASS: TestAccAWSElasticacheSubnetGroup_basic (18.13s)
--- PASS: TestAccAWSElasticacheSecurityGroup_basic (22.27s)
--- PASS: TestAccAWSElasticacheSubnetGroup_update (16.73s)
--- PASS: TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption (704.51s)
--- PASS: TestAccAWSElasticacheReplicationGroup_basic (793.07s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow (844.62s)
--- PASS: TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2 (886.63s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateParameterGroup (936.73s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateDescription (950.16s)
--- PASS: TestAccAWSElasticacheReplicationGroup_Uppercase (964.36s)
--- PASS: TestAccAWSElasticacheReplicationGroup_enableSnapshotting (983.89s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_Basic (1108.91s)
--- PASS: TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption (1340.12s)
--- PASS: TestAccAWSElasticacheReplicationGroup_vpc (1482.62s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateNodeSize (1877.17s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverDisabled (2040.78s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters (2369.20s)
--- PASS: TestAccAWSElasticacheReplicationGroup_multiAzInVpc (2431.31s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverEnabled (2492.96s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_NumNodeGroups (3306.50s)

@@ -98,24 +75,32 @@ func TestAccAWSElasticacheReplicationGroup_basic(t *testing.T) {
{
Config: testAccAWSElasticacheReplicationGroupConfig(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg),
testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.test", &rg),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I do not want to hold up this PR over it, but these should be using the new resourceName variable

maintenance_window = "thu:03:00-thu:04:00"
}
`, acctest.RandInt(), acctest.RandInt(), acctest.RandString(10))
# InvalidParameterValue: Specified node type cache.m3.medium is not available in AZ us-east-1b.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Looks like the formatting of this configuration got switched from 2 spaces to tabs

@bflad bflad added this to the v2.34.0 milestone Oct 28, 2019
@ryndaniels ryndaniels merged commit f52d0cb into master Oct 29, 2019
@ryndaniels ryndaniels deleted the rfd-at002-elasticache branch October 29, 2019 09:24
@ghost
Copy link

ghost commented Mar 29, 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 Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/elasticache Issues and PRs that pertain to the elasticache 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.

2 participants