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

Ability to test whether warnings are raised during test steps #16

Closed
bendbennett opened this issue Jan 3, 2023 · 2 comments · May be fixed by #17
Closed

Ability to test whether warnings are raised during test steps #16

bendbennett opened this issue Jan 3, 2023 · 2 comments · May be fixed by #17
Labels
enhancement New feature or request

Comments

@bendbennett
Copy link
Contributor

bendbennett commented Jan 3, 2023

This issue is a duplicate of Ability to test whether warnings are raised during test steps.

Version

N/A

Use-cases

Currently, ExpectError field only allows checking errors, not warnings. This makes provider developers hard to test certain scenarios where warnings are expected and want to validate the exact behavior in tests.

Attempted Solutions

N/A

Proposal

Add an ExpectWarning field to TestStep and use json output from terraform commands to determine whether warnings have been generated during execution of a test step.

Requires changes to terraform-exec to add support for executing terraform commands with -json option (see References below for links to relevant issue and PRs on terraform-exec repository.

References

@bendbennett bendbennett added the enhancement New feature or request label Jan 3, 2023
bendbennett added a commit that referenced this issue Jan 3, 2023
…ry and unmarshalling onto terraform-json diagnostic to verify warning matches expected regex (#16)
bendbennett added a commit that referenced this issue Jan 3, 2023
bendbennett added a commit that referenced this issue Jan 12, 2023
…ry and unmarshalling onto terraform-json diagnostic to verify warning matches expected regex (#16)
bendbennett added a commit that referenced this issue Jan 12, 2023
bendbennett added a commit that referenced this issue Jan 12, 2023
bendbennett added a commit that referenced this issue Jan 13, 2023
bendbennett added a commit that referenced this issue Jan 16, 2023
…her than ApplyJSON()) if running commands with -json flag raises an ErrVersionMismatch error (#16)
bendbennett added a commit that referenced this issue Jan 18, 2023
@bendbennett bendbennett added this to the v1.1.0 milestone Jan 19, 2023
bendbennett added a commit that referenced this issue Jan 23, 2023
…son.Diagnostic into a separate TerraformJSONDiagnostics type (#16)
bendbennett added a commit that referenced this issue Jan 24, 2023
bendbennett added a commit that referenced this issue Jan 24, 2023
…nces of NewTerraformJSONBuffer within each command (#16)
bendbennett added a commit that referenced this issue Jan 31, 2023
bendbennett added a commit that referenced this issue Jan 31, 2023
@bflad bflad removed this from the v1.1.0 milestone Feb 14, 2023
@bflad
Copy link
Member

bflad commented Feb 28, 2023

Closing as a duplicate of the (now transferred) #69.

@bflad bflad closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2023
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 Mar 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants