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

Add PlanCheck to update test creation #11751

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

trodge
Copy link
Contributor

@trodge trodge commented Sep 19, 2024

This additional step will ensure that new update tests always update the resource in-place rather than delete and recreate.

Release Note Template for Downstream PRs (will be copied)


@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

I'm seeing a lot of the current implementations in other tests are as follows:

ConfigPlanChecks: resource.ConfigPlanChecks{
					PreApply: []plancheck.PlanCheck{
						acctest.ExpectNoDelete(),
					},
				},

Should this be suggested or mentioned as an option for update-steps that update more than one resource at once?

Also is there plans to update most other existing tests to use this check, or will we just be recommending it going forward?

@trodge
Copy link
Contributor Author

trodge commented Sep 20, 2024

I'm seeing a lot of the current implementations in other tests are as follows:

ConfigPlanChecks: resource.ConfigPlanChecks{
					PreApply: []plancheck.PlanCheck{
						acctest.ExpectNoDelete(),
					},
				},

Should this be suggested or mentioned as an option for update-steps that update more than one resource at once?

Also is there plans to update most other existing tests to use this check, or will we just be recommending it going forward?

The plan is to eventually update existing tests to use ExpectResourceAction, and this is preferred over ExpectNoDelete

@trodge trodge merged commit b177a19 into GoogleCloudPlatform:main Sep 23, 2024
10 checks passed
@trodge trodge deleted the plan-check-docs branch September 23, 2024 18:15
abd-goog pushed a commit to abd-goog/magic-modules that referenced this pull request Sep 26, 2024
niharika-98 pushed a commit to niharika-98/magic-modules that referenced this pull request Oct 7, 2024
Philip-Jonany pushed a commit to Philip-Jonany/magic-modules that referenced this pull request Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants