You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the test framework throws an error for every failed assertion. That’s usually fine, but sometimes it’s a problem because it interrupts our pipeline or workflow. Sometimes we just want to get a warning instead, so we know something’s off without completely breaking the flow, or if it's just a minor error.
For example, we have a policy where VMs aren’t supposed to have HDDs, so we wrote a test for that. But sometimes we actually need to check if the HDD works or there’s a specific reason we need to use one. In those cases, it would be way better if the test just logged a warning instead of causing the whole pipeline to fail, our devs could see the warning and choose to ignore it, or choose to take action.
Benefits
makes test outcomes more flexible.
helps separate critical errors from minor warnings.
Attempted Solutions
Right now there’s no way to do this. If an assertion fails, it always throws an error.
Proposal
Add an option to mark an assertion as a warning instead of an error. Maybe something like this: result_type = warning
It could work similar to how the command option is used.
References
No response
The text was updated successfully, but these errors were encountered:
Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again!
Terraform Version
Use Cases
Right now the test framework throws an error for every failed assertion. That’s usually fine, but sometimes it’s a problem because it interrupts our pipeline or workflow. Sometimes we just want to get a warning instead, so we know something’s off without completely breaking the flow, or if it's just a minor error.
For example, we have a policy where VMs aren’t supposed to have HDDs, so we wrote a test for that. But sometimes we actually need to check if the HDD works or there’s a specific reason we need to use one. In those cases, it would be way better if the test just logged a warning instead of causing the whole pipeline to fail, our devs could see the warning and choose to ignore it, or choose to take action.
Benefits
Attempted Solutions
Right now there’s no way to do this. If an assertion fails, it always throws an error.
Proposal
Add an option to mark an assertion as a warning instead of an error. Maybe something like this:
result_type = warning
It could work similar to how the
command
option is used.References
No response
The text was updated successfully, but these errors were encountered: