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

New Checks: Avoid ID-Only Refresh Testing in Acceptance Testing #228

Closed
bflad opened this issue Mar 23, 2021 · 0 comments · Fixed by #229
Closed

New Checks: Avoid ID-Only Refresh Testing in Acceptance Testing #228

bflad opened this issue Mar 23, 2021 · 0 comments · Fixed by #229
Labels
ast AST Handling check/acctest Acceptance Testing Check new-check New Lint Check
Milestone

Comments

@bflad
Copy link
Owner

bflad commented Mar 23, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Identifier only refresh testing is generally a legacy testing practice before full import testing was the normal convention and the testing framework automatically performed refresh after apply. Other use cases for IDRefreshName are not clear.

New Checks

  • AT010: Prefer TestStep.ImportState over TestCase.IDRefreshName
  • AT011: Avoid TestCase.IDRefreshIgnore without TestCase.IDRefreshName

Flagged Provider Code

resource.TestCase{
	// ... other configuration ...
	IDRefreshName: "example_thing.test",
})

resource.TestCase{
	// ... other configuration except IDRefreshName ...
	IDRefreshIgnore: []string{"attr"},
})

Passing Provider Code

resource.TestCase{
	// ... other configuration ...
})

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ast AST Handling check/acctest Acceptance Testing Check new-check New Lint Check
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant