-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
terraform test
crash on multiple run blocks in file
#33780
Comments
terraform test
crash on multiple run blocks in file
Hi @matt-FFFFFF! Thanks for this and sorry for the crash. Do you have the crash stack trace available to share? I will try and reproduce this as well, but that might speed things up. Thanks! |
Hey @liamcervante Thanks for the response - here it is
|
Thanks for that, super helpful! So the crash is originating here: https://github.com/hashicorp/terraform/blob/main/internal/backend/local/test.go#L1348 It's caused by the outputs you have defined that are returning null. Terraform is just not including them in the set of outputs and the test file is expecting them to be there as it is looking in the config for the true set of outputs. This is definitely a bug, so we'll get it fixed for the next beta release. Thanks for finding it. |
Unfortunately, I don't have a good workaround for you here. The only thing I can think of is ensuring that in your tests that the |
Thanks for confirming. Any idea why it doesn't happen with only one of the Appreciate the speedy response :) |
Yes - Terraform attempts to make the outputs of all the previous run blocks available to each run block as it executes. If there is only a single run block then it never has any previous run blocks to process, and so it never encounters the |
This should be fixed in the next beta release! |
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. |
Terraform Version
Terraform Configuration Files
Debug Output
https://gist.github.com/matt-FFFFFF/629b3fa191f3618b07c0d32a628c01c8
Expected Behavior
Not crash!
Actual Behavior
Crashed when both run blocks are in the test file.
Either one works on its own.
Steps to Reproduce
Additional Context
Link to sub-module: https://github.com/Azure/terraform-azurerm-lz-vending/tree/spike/terraformtest/modules/subscription
References
No response
The text was updated successfully, but these errors were encountered: