Skip to content
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

helper/resource.TestCheckResourceAttrPair() Does Not Return Error If Comparing Self #334

Closed
bflad opened this issue Feb 21, 2020 · 2 comments · Fixed by #335
Closed

helper/resource.TestCheckResourceAttrPair() Does Not Return Error If Comparing Self #334

bflad opened this issue Feb 21, 2020 · 2 comments · Fixed by #335
Labels
bug Something isn't working

Comments

@bflad
Copy link
Contributor

bflad commented Feb 21, 2020

SDK version

v1.7.0

Relevant provider source code

// Usually less obvious with variable usage
resource.TestCheckResourceAttrPair("example_thing.test", "attr", "example_thing.test", "attr"),

Terraform Configuration Files

N/A -- can be covered via unit testing

Expected Behavior

The acceptance testing function should return an error saying the same resource state values are being checked against each other, which will always pass. It is more likely the developer intended to check either different attributes in the same resource (seems like an odd case, but should be still allowed) or different resources (most likely; e.g. checking data source attribute versus resource attribute).

Actual Behavior

No errors returned by TestCheckResourceAttrPair() and acceptance testing passes.

Steps to Reproduce

TF_ACC=1 go test ./... -count=1 -run='ExampleThing_' -v

References

@bflad bflad added the bug Something isn't working label Feb 21, 2020
bflad added a commit to bflad/terraform-plugin-sdk that referenced this issue Feb 21, 2020
…omparing self

Reference: hashicorp#334

Also consolidates the unit testing for the function.
appilon pushed a commit to bflad/terraform-plugin-sdk that referenced this issue Mar 4, 2020
…omparing self

Reference: hashicorp#334

Also consolidates the unit testing for the function.
@paultyng
Copy link
Contributor

paultyng commented Mar 4, 2020

Going to close this since the PR was merged in v2.

@paultyng paultyng closed this as completed Mar 4, 2020
appilon pushed a commit that referenced this issue Mar 11, 2020
…omparing self

Reference: #334

Also consolidates the unit testing for the function.
@ghost
Copy link

ghost commented Apr 4, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
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