Closed as not planned
Description
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.