From d8a232317ca21ce04a4862685c71f20c5111cdb3 Mon Sep 17 00:00:00 2001 From: Sarah French Date: Mon, 13 Jan 2025 19:47:01 +0000 Subject: [PATCH] Add details about how XML's contents maps to `test` concepts, and include info about attributes --- website/docs/cli/commands/test.mdx | 32 +++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/website/docs/cli/commands/test.mdx b/website/docs/cli/commands/test.mdx index a675adbda350..23f27f964817 100644 --- a/website/docs/cli/commands/test.mdx +++ b/website/docs/cli/commands/test.mdx @@ -206,4 +206,34 @@ local.false did not match expected value -``` \ No newline at end of file +``` + +The file maps Terraform test command concepts to JUnit XML format according to the table below: + +| Terraform test concept | Element in JUnit XML output | +| ---------------------------| --------------------------------------------| +| Test directory | `` | +| Test file | `` | +| Run block | `` | +| Run block assertion | None; details are included only on failure | +| Test failure | `` | +| Test was skipped | `` | +| Test stopped due to error | `` | +| Stderr output from command | `` | + +Different elements can include attributes that describe the test suite further. These attributes are described below: + +| JUnit XML Element | Attribute | Meaning | +| -----------------------| ----------------------------|-------------------------------------------------------| +| `` | `name` | The test file name | +| `` | `tests` | Count of total tests (run blocks) in the file | +| `` | `skipped` | Count of skipped tests (run blocs) count in the file | +| `` | `failures` | Count of failed tests (run blocks) count in the file | +| `` | `errors` | Count of errored tests (run blocks) count in the file | +| `` | `name` | The run block's name | +| `` | `classname` | The name of the file containing the run block | +| `` | `time` | The duration of executing the run block | +| `` | `timestamp` | The start time when executing the run block | +| `` | `message` | A message describing the test failure | +| `` | `message` | A message describing the test error | +| `` | `message` | A message describing why the test was skipped | \ No newline at end of file