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

sweepers/timestreamwrite_database: fix sweeper error handling; add _disappears test #19351

Merged
merged 2 commits into from
May 13, 2021

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented May 13, 2021

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

Description:

  • previously, the sweeper did not account for DeleteWithoutTimeout usage implemented in resource

Output from acceptance testing:

--- PASS: TestAccAWSTimestreamWriteDatabase_disappears (15.24s)

@anGie44 anGie44 requested a review from a team as a code owner May 13, 2021 01:47
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/timestreamwrite Issues and PRs that pertain to the timestreamwrite service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 13, 2021
@anGie44 anGie44 added the technical-debt Addresses areas of the codebase that need refactoring or redesign. label May 13, 2021
@anGie44 anGie44 force-pushed the t-timestreamwrite-database-sweeper branch from aaf1369 to 366a9d3 Compare May 13, 2021 05:13
@anGie44 anGie44 force-pushed the t-timestreamwrite-database-sweeper branch from 366a9d3 to 2ed55ca Compare May 13, 2021 05:33
@ghost ghost added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels May 13, 2021
@anGie44 anGie44 changed the title sweepers/timestreamwrite_database: fix sweeper error handling sweepers/timestreamwrite_database: fix sweeper error handling; add _disappears test May 13, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

% make testacc TEST=./aws TESTARGS='-run=TestAccAWSTimestreamWriteDatabase_disappears'                                                                 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSTimestreamWriteDatabase_disappears -timeout 180m
=== RUN   TestAccAWSTimestreamWriteDatabase_disappears
=== PAUSE TestAccAWSTimestreamWriteDatabase_disappears
=== CONT  TestAccAWSTimestreamWriteDatabase_disappears
--- PASS: TestAccAWSTimestreamWriteDatabase_disappears (14.96s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	17.920s
% TEST=./aws SWEEP=us-west-2 SWEEPARGS=-sweep-run=aws_timestreamwrite_database make sweep
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./aws -v -sweep=us-west-2 -sweep-run=aws_timestreamwrite_database -timeout 60m
2021/05/13 10:42:53 [DEBUG] Running Sweepers for region (us-west-2):
2021/05/13 10:42:53 [DEBUG] Running Sweeper (aws_timestreamwrite_database) in region (us-west-2)
2021/05/13 10:42:53 [INFO] AWS Auth provider used: "EnvProvider"
2021/05/13 10:42:53 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/05/13 10:42:54 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/05/13 10:42:57 Sweeper Tests ran successfully:
	- aws_timestreamwrite_database
ok  	github.com/terraform-providers/terraform-provider-aws/aws	7.230s

Would be nice for resourceAwsTimestreamWriteDatabaseDelete to have a log line like

log.Printf("[DEBUG] Deleting Timestream Database (%s)", d.Id())

I verified that a database I created via the AWS Console was deleted in the sweep.

@anGie44
Copy link
Contributor Author

anGie44 commented May 13, 2021

Would be nice for resourceAwsTimestreamWriteDatabaseDelete to have a log line like

@ewbankkit do you mean to give the sweeper output more context? I've noticed in some resources we've gone about reducing the amount of logging but I can definitely add a line in the test file

Output of sweeper with change:

go test ./aws -v -sweep=us-east-1,us-west-2 -sweep-run=aws_timestreamwrite_database -timeout 60m
2021/05/13 15:09:08 [DEBUG] Running Sweepers for region (us-east-1):
2021/05/13 15:09:08 [DEBUG] Running Sweeper (aws_timestreamwrite_database) in region (us-east-1)
2021/05/13 15:09:08 [INFO] AWS Auth provider used: "EnvProvider"
2021/05/13 15:09:08 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/05/13 15:09:09 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/05/13 15:09:09 Sweeper Tests ran successfully:
	- aws_timestreamwrite_database
2021/05/13 15:09:09 [DEBUG] Running Sweepers for region (us-west-2):
2021/05/13 15:09:09 [DEBUG] Running Sweeper (aws_timestreamwrite_database) in region (us-west-2)
2021/05/13 15:09:09 [INFO] AWS Auth provider used: "EnvProvider"
2021/05/13 15:09:09 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/05/13 15:09:09 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/05/13 15:09:11 [INFO] Deleting Timestream Database (tf-acc-test-8775165386961036904)
2021/05/13 15:09:11 Sweeper Tests ran successfully:
	- aws_timestreamwrite_database
ok  	github.com/terraform-providers/terraform-provider-aws/aws	5.492s

@anGie44 anGie44 modified the milestones: v3.37.1, v3.40.0 May 13, 2021
@anGie44 anGie44 merged commit a184b95 into main May 13, 2021
@anGie44 anGie44 deleted the t-timestreamwrite-database-sweeper branch May 13, 2021 19:58
@ghost
Copy link

ghost commented May 13, 2021

This has been released in version 3.40.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!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/timestreamwrite Issues and PRs that pertain to the timestreamwrite service. size/S 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