Skip to content

The error message for plancheck.ExpectUnknownValue is misleading when value is known #450

@gdavison

Description

@gdavison

terraform-plugin-testing version

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

Relevant provider source code

plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New(names.AttrRule).AtSliceIndex(0).AtMapKey("prefix"))

Expected Behavior

The test failure message should indicate something like

Expected unknown value for 'rule[0].prefix', but had known value "prefix".

Actual Behavior

The test failure message is

path not found: specified key prefix not found in map at rule.0.prefix

Steps to Reproduce

  1. Run an acceptance test with a plancheck.ExpectUnknownValue where the plan returns a known value

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions