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

Proposal: Add RefreshOnly acceptance test step type #1069

Closed
gdavison opened this issue Sep 27, 2022 · 1 comment · Fixed by #1070
Closed

Proposal: Add RefreshOnly acceptance test step type #1069

gdavison opened this issue Sep 27, 2022 · 1 comment · Fixed by #1070
Assignees
Labels
enhancement New feature or request subsystem/tests Issues and feature requests related to the testing framework.
Milestone

Comments

@gdavison
Copy link
Contributor

Use-cases

Some resource types can have state changes based on interactions with other resource types.

For example, an AWS ACM Certificate issued by an ACM Private CA is ineligible for managed renewal if it is not exported or associated with another AWS service. It would be useful to be able to validate new Computed values without doing an apply.

Attempted Solutions

Using a PlanOnly step will fail because there is a diff, and ExpectNonEmptyPlan simply reports that there is a diff (#482).

Proposal

Add a RefreshOnly test step. This would allow using resource.TestCheckFuncs against the refreshed values.

@gdavison gdavison added the enhancement New feature or request label Sep 27, 2022
bendbennett added a commit that referenced this issue Sep 29, 2022
bendbennett added a commit that referenced this issue Oct 6, 2022
@bflad bflad added the subsystem/tests Issues and feature requests related to the testing framework. label Oct 10, 2022
@bflad bflad added this to the v2.24.0 milestone Oct 10, 2022
bendbennett added a commit that referenced this issue Oct 11, 2022
bendbennett added a commit that referenced this issue Oct 11, 2022
bendbennett added a commit that referenced this issue Oct 11, 2022
bendbennett added a commit that referenced this issue Oct 12, 2022
* Adding RefreshState test step (#1069)

* Adding CHANGELOG entry (#1069)

* Running TestCheckFunc with refreshed state (#1069)

* Adding validation to check conditions for RefreshState (#1069)

* Expanding comments on RefreshState (#1069)

* Removing option to override config during refresh testing, removing re-init and adding plan following refresh (#1069)

* Adding test coverage for to verify expect non-empty plan following refresh (#1069)

* Apply suggestions from code review

Co-authored-by: Brian Flad <bflad417@gmail.com>

* Adding validation to verify that refresh state is not present with config or destroy in a test step (#1069)

* Reset time during test step so that ReadContext does not mutate state and result in a diff (#1069)

* Updating website docs (#1069)

* Apply suggestions from code review

Co-authored-by: Brian Flad <bflad417@gmail.com>

* Test to verify that setting config and refresh state together is not valid (#1069)

Co-authored-by: Brian Flad <bflad417@gmail.com>
@github-actions
Copy link

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 have found a problem that seems similar to this, 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 Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request subsystem/tests Issues and feature requests related to the testing framework.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants