Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote JUnit output 'terraform test' feature from experimental status #36228

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Dec 17, 2024

This PR promotes the JUnit output of the terraform test command out of experimental status.

The PR is blocked by a separate PR to refactor the code prior to promotion.

TODO

  • Add documentation to the test command docs
  • Address remaining feedback

Target Release

1.11.x

Draft CHANGELOG entry

NEW FEATURES

  • terraform test: The terraform test command's feature to output a JUnit XML test result report is now generally available. To use this feature, pass the flag -junit-xml=FILENAME to the terraform test command.

@SarahFrench SarahFrench changed the title Junit test output concluded experiment Promote JUnit output 'terraform test' feature from experimental status Dec 17, 2024
@SarahFrench SarahFrench force-pushed the junit-test-output-concluded-experiment branch from 0179ead to 33c3051 Compare January 6, 2025 10:29
| Test file | `<testsuite>` | There will be as many `<testsuite>` elements as there are test files. The tests in a `<testsuite>` are summarized in its attributes: `name` is the file name; `tests` is total count of tests; `skipped` is a count of skipped tests; `failures` is a count of failed tests, `errors` is a count of errored tests. |
| Run block | `<testcase>` | Any `<testcase>` elements will be nested inside a parental `<testsuite>` element corresponding to the file that contains the run block. |
| Test failure error | `<failure>` | If a `<testcase>` fails then it will contain a `<failure>` element that contains a message about a test failure. |
| ??? | `<system-err>` | ??? |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To do!

This will hopefully be made clear during work on a related PR that refactors and adds test coverage to the feature

Comment on lines +248 to +256
<failure message="Test run failed"></failure>
<system-err><![CDATA[
Error: Test assertion failed

on example_2.tftest.hcl line 21:
(source code not available)

local.false did not match expected value
]]></system-err>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely to change after refactoring prior to promoting the feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant