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

Test framework: ExpectError test steps result in state being cleared #118

Closed
alexng-canuck opened this issue Sep 26, 2018 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@alexng-canuck
Copy link

When tests have an ExpectError test step that expects some sort of validation error; this results in any previous state being cleared. Any subsequent test steps will no longer have the previous state, resulting in resources being created again rather than reusing the state from before the error.

Terraform Version

0.11.7

Terraform Configuration Files

Not Applicable

Debug Output

Crash Output

Expected Behavior

Suppose we have 3 test steps:

  1. Create a resource
  2. Change the config to force some validation error and expect that error.
  3. Update the resource.

The state should still be preserved after step 2; and step 3 should update the resources created in step 1.

Actual Behavior

Step 3 will end up creating the resources from step 1 again. This is resulting in resources from step 1 being leaked.

Steps to Reproduce

Additional Context

This behavior regressed from v0.9; where the expected behavior occurred.

References

@hashibot hashibot transferred this issue from hashicorp/terraform Sep 26, 2019
@hashibot hashibot added bug Something isn't working testing labels Oct 2, 2019
@kmoe
Copy link
Member

kmoe commented Mar 27, 2020

This is fixed in #262, the new binary acceptance test driver, which can be enabled from v1.7.0 onwards.

@ghost
Copy link

ghost commented Apr 27, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants