Skip to content

Indicate missing attributes in knownvalue.ObjectExact failure messages #451

@gdavison

Description

@gdavison

terraform-plugin-testing version

github.com/hashicorp/terraform-plugin-testing v1.11.0

Use cases

When assessing a test failure, I want the error message to indicate what has failed

Attempted solutions

Setting a breakpoint in knownvalue.ObjectExact and running the debugger

Proposal

Currently, if the number of expected and actual attributes in knownvalue.ObjectExact don't match, the check immediately exits and returns an error such as

expected 2 attributes for ObjectExact check, got 3 attributes

without indicating what the additional attributes are. This can happen in plan checks, as unknown values are not included at all in the value.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions