-
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: produces invalid warning during cleanup phase #35061
Comments
The particular problematic validation is that we try to make sure that variables defined within run blocks are actually used within the execution of that run block. We print a warning if we find an unused variable. In the example test file, we provide values for two variables From the output, you can see that the run block executes with no warnings and then we get a warning after the Indeed, you can see that during the terraform/internal/backend/local/test.go Lines 427 to 434 in 4487751
But, during the terraform/internal/backend/local/test.go Line 640 in 4487751
One potential solution is to modify the Another potential solution would be to move the source of the warning from here into the I'd be happy with either of these solutions. |
@liamcervante Are
If this is a good solution let me know and I'll make a pull request. |
Hi @MicahKimel, apologies for the delay here - I was away on annual leave. Yes, I think that's fine but we could also update the doc comment for the function itself to state that I'd be happy to review a PR if you raised one 👍 Thanks! |
I failed to run all the test cases and realized my proposed solution removed useful dialog info such as this.
So I'm looking into other potential solutions so we can still receive warnings when invalid variables are declared. |
Terraform Version
Terraform Configuration Files
Debug Output
N/A
Expected Behavior
Actual Behavior
Steps to Reproduce
terraform init
terraform test
Additional Context
No response
References
No response
The text was updated successfully, but these errors were encountered: