-
Notifications
You must be signed in to change notification settings - Fork 10k
Description
Terraform Version
Terraform v1.11.1
on windows_amd64
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
- 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