Restore pre-binary testing ExpectNonEmptyPlan behavior. #580
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TestSteps do a number of things: first they apply a config, then they
run some checks on that config, then they do a plan without
refreshing, then refresh, then do another plan.
When you tell a TestStep you expect a non-empty plan, right now it
expects both those plans to come back empty. Pre-binary testing,
however, it only required the second one to come back non-empty.
This matters because some providers overload TestChecks to modify
resources out of band. When this is done, there's a plan without a
refresh (that won't see the modifications) and a plan after a refresh
(that will see the changes). If both are forced to agree on whether the
plan should be empty or not, you can't use that pattern anymore, because
they can't both be right.
This restores the original behavior of allowing the first plan to be
non-empty or empty when ExpectNonEmptyPlan is set to true (it must be
empty when ExpectNonEmptyPlan is false), but requiring the second plan,
after the refresh, to be non-empty when ExpectNonEmptyPlan is true.