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
Running the upcoming terraform test -json command has specific JSON message types, e.g.
{"@level":"info","@message":"Found 1 file and 1 run block","@module":"terraform.ui","@timestamp":"2023-07-25T10:03:42.974507-04:00","test_abstract":{"tests/passthrough.tftest":["variable_output_passthrough"]},"type":"test_abstract"}
{"@level":"info","@message":"tests/passthrough.tftest... fail","@module":"terraform.ui","@testfile":"tests/passthrough.tftest","@timestamp":"2023-07-25T10:03:42.977420-04:00","test_file":{"path":"tests/passthrough.tftest","status":"fail"},"type":"test_file"}
{"@level":"info","@message":" \"variable_output_passthrough\"... fail","@module":"terraform.ui","@testfile":"tests/passthrough.tftest","@testrun":"variable_output_passthrough","@timestamp":"2023-07-25T10:03:42.977444-04:00","test_run":{"path":"tests/passthrough.tftest","run":"variable_output_passthrough","status":"fail"},"type":"test_run"}
{"@level":"error","@message":"Error: Test assertion failed","@module":"terraform.ui","@testfile":"tests/passthrough.tftest","@testrun":"variable_output_passthrough","@timestamp":"2023-07-25T10:03:42.977566-04:00","diagnostic":{"severity":"error","summary":"Test assertion failed","detail":"variable was not passed through to output","range":{"filename":"tests/passthrough.tftest","start":{"line":9,"column":21,"byte":123},"end":{"line":9,"column":50,"byte":152}},"snippet":{"context":"run \"variable_output_passthrough\"","code":" condition = output.test == \"test value 2\"","start_line":9,"highlight_start_offset":20,"highlight_end_offset":49,"values":[{"traversal":"output.test","statement":"is \"test value\""}]}},"type":"diagnostic"}
{"@level":"info","@message":"Failure! 0 passed, 1 failed.","@module":"terraform.ui","@timestamp":"2023-07-25T10:03:42.980799-04:00","test_summary":{"status":"fail","passed":0,"failed":1,"errored":0,"skipped":0},"type":"test_summary"}
Proposal
Add the following type definitions, similar to Diagnostic message handling:
// "test_abstract":{"tests/passthrough.tftest":["variable_output_passthrough"]}// Could potentially be defined as type TestAbstract map[string][]string// "test_file":{"path":"tests/passthrough.tftest","status":"fail"}typeTestFilestruct {
PathstringStatusstring// potentially introduce constants?
}
// "test_run":{"path":"tests/passthrough.tftest","run":"variable_output_passthrough","status":"fail"}typeTestRunstruct {
PathstringRunstringStatusstring// potentially introduce constants?
}
// "test_summary":{"status":"fail","passed":0,"failed":1,"errored":0,"skipped":0}typeTestSummarystruct {
ErroredintFailedintPassedintSkippedintStatusstring// potentially introduce constants?
}
The text was updated successfully, but these errors were encountered:
Description
Running the upcoming
terraform test -json
command has specific JSON message types, e.g.Proposal
Add the following type definitions, similar to
Diagnostic
message handling:The text was updated successfully, but these errors were encountered: