Skip to content

v0.12 - ImportStateVerify tests failing for attributes where ResourceData.Set isn't called #20985

@alexng-canuck

Description

@alexng-canuck

Terraform Version

v0.12.0-alpha4.0.20190410151648-50660032848d

Debug Output

Expected Behavior

Some OCI services may omit an attribute in its response to our provider and so the provider avoids calling ResourceData.Set on such computed attributes. (i.e. it shouldn't have a value in state)

ImportStateVerify tests on such resources would result in a pass in v0.11.

Actual Behavior

We now get this error in v0.12. In the expected state, it seems to be checking that some zero-value is present even though we never set one. While the actual state omits these values because we never called into Resource.SetData.

--- FAIL: TestBudgetBudgetResource_basic (916.96s)
    testing.go:568: Step 7 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=2) {
         (string) (len=12) "actual_spend": (string) (len=1) "0",
         (string) (len=16) "forecasted_spend": (string) (len=1) "0"
        }
        
FAIL

Additional Context

References

Possibly related to: #20221

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions