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

[Testing framework] Implement JSON view functionality for test command #33400

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

liamcervante
Copy link
Member

This PR adds the TestJSON struct to the views package for use by the terraform test -json command.

It also adds a new function DestroySummary on the Test interface which prints out the results of the destroy operation that occurs at the end of every test file. Implementations for this are added to the already existing TestHuman struct as well as the new JSON struct.

This PR also extends the diagnostics implementation for JSONView, by allowing callers to provide additional metadata to be attached to the produced JSON entries. This is used by the test command to attach @testrun and @testfile entries to produced diagnostics to help TFC link diagnostics back to the relevant test cases.

@liamcervante liamcervante requested a review from a team June 20, 2023 14:32
@liamcervante liamcervante merged commit ed82255 into main Jun 28, 2023
@liamcervante liamcervante deleted the liamcervante/tests/json branch June 28, 2023 07:30
@github-actions
Copy link
Contributor

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants