-
Notifications
You must be signed in to change notification settings - Fork 15
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
Core FR: Check that only an 'update' occurred in a test #61
Comments
+1! The workaround for this, right now, is to manually examine the debug output for every single test every time we write any code which touches |
Another possible workaround here would be to save the value of some id attribute that changes when the object is replaced in the prior step, and then in the subsequent check step verify that the two ids match. This will, of course, work only if there is some id attribute on the object that remains static on update and changes on replace. I agree that it'd be more ergonomic to either assert against the planned changes or to declare in the test step that it should contain no replace actions. I'm sorry for the long silence here. I've updated the labels on this issue to put it on the radar of the team that is responsible for the provider SDK ( |
Unfortunately that's not usually the case in GCP, but I can see how it might be elsewhere, which would definitely make this a lower-priority improvement. Thanks for the update! |
Hi, I've submitted hashicorp/terraform-plugin-sdk#329 which should address this issue (and hashicorp/terraform-plugin-sdk#222 which looks very similar). |
Hello longtime subscribers of this issue 👋🏻 , We've recently released Plan Checks with There is an example of how to use this plan check in the linked documentation on the developer portal, but please open a new issue if you run into problems, or open a post on our discuss board for other questions. |
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. |
In hashicorp/terraform#15101 and hashicorp/terraform#15102, it was discovered that tests that we thought were testing update were actually just doing a destroy and recreate. It would be great to have another option in
TestStep
that would confirm that no resources were destroyed or created in a step, only updated. In this particular scenario, if the test had been written correctly, it would have caught the bug leading to hashicorp/terraform#15056 potentially before it was caught by a user.The text was updated successfully, but these errors were encountered: