improve wording of error message

pull/35862/head
Daniel Schmidt 2 years ago
parent 6d582ec5b7
commit 3e7fdd0de9
No known key found for this signature in database
GPG Key ID: 377C3A4D62FBBBE2

@ -272,8 +272,7 @@ func TestTest_Runs(t *testing.T) {
},
"ephemeral_resource": {
expectedOut: []string{"0 passed, 1 failed."},
// TODO: Improve error message, say something about ephemeral resources not being accessible in tests due to their ephemeral nature
expectedErr: []string{"Ephemeral resource instance has expired", "Ephemeral resources not supported in the context of tests"},
expectedErr: []string{"Ephemeral resource instance has expired", "Ephemeral resources cannot be asserted"},
code: 1,
},
}

@ -211,8 +211,8 @@ func diagsForEphemeralResources(refs []*addrs.Reference) (diags tfdiags.Diagnost
if v.Resource.Mode == addrs.EphemeralResourceMode {
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Ephemeral resources not supported in the context of tests",
Detail: "Ephemeral resources are not supported in the context of terraform test.",
Summary: "Ephemeral resources cannot be asserted",
Detail: "Ephemeral resources are closed when the test is finished, and are not available within the test context for assertions.",
Subject: ref.SourceRange.ToHCL().Ptr(),
})
}

Loading…
Cancel
Save