Consider allowing PlanCheck
implementations to trigger (*testing.T).Skip()
#108
Labels
enhancement
New feature or request
Description
Plan Checks can currently return an error in
PlanCheckResponse.Error
to trigger the equivalent of(*testing.T).Error()
and exit a test if the plan fails the assertion made. We should consider adding functionality to allow plan checks the ability to trigger(*testing.T).Skip()
with a message.For example, given a data source attribute value, skip the rest of this test. In the real world, this could be as trivial as a configuration such as:
And wanting to skip the test if
data.aws_partition.test.name != "aws"
for services only available in the AWS Commercial partition.This could prevent provider developers from needing to implement
TestCase.ErrorCheck
based on API error messaging they may not control.Proposal
Add a
Skip
string field to theCheckPlanResponse
struct. Any plan check that sets this field would immediately invoke(*testing.T).Skip(skipMsg)
with the string provided. All normal cleanup/defer functions should still be run - i.e. post-test destroy and temp file cleanup.References
plancheck.ExpectResourceAction
,plancheck.ExpectEmptyPlan
, andplancheck.ExpectNonEmptyPlan
#63The text was updated successfully, but these errors were encountered: