Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gdavison opened this issue Mar 14, 2025 · 1 comment · Fixed by #456
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@gdavison
Copy link
Contributor

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
@gdavison gdavison added the bug Something isn't working label Mar 14, 2025
@austinvalle
Copy link
Member

Agreed! Will look into this before our next release 👍🏻

@austinvalle austinvalle added this to the v1.12.0 milestone Mar 14, 2025
@austinvalle austinvalle self-assigned this Mar 14, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
2 participants