Open wyardley opened 1 month ago
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
In the case of tests, having the
error_message
in the test assertions is not especially useful, and makes the tests slower to write. In a lot of cases, the assertion itself is pretty clear to understand. My proposal is to makeerror_message
optional, and to add adescription
field to each test case, as well as to each assertion (with the understanding that tests may have many assertions).Then, the
terraform test
output should show a dot for each assertion (similar to rspec's compact format), or the description of each assertion next to it in an expanded format (similar to mocha, pytest, rspec). If dynamic blocks or iteration are supported (as suggested here, there could maybe be a variable to provide the current value in the message as a formatting string.If a description or error message isn't provided, the test could either provide just the output it provides on failure now, or it could provide a terser human readable summary of what the assertion is testing.
Having a configurable
-output-format
or-format
or-output
flag would also support things like generating xml reports or allowing GitHub style output for automagic annotation.Attempted Solutions
n/a
Proposal
Then running terraform test:
or (exact formatting, command line flag, etc. could be different, just kind of an example)
Errors could be indicated on a line by line basis, and then more details provided at the end.
References
No response