Skip to content

getting ImportStateVerify attributes not equivalent. when bumping to v1.6.0 #393

@BBBmau

Description

@BBBmau

terraform-plugin-testing version

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

Relevant provider source code

Could be due to this PR

Terraform Configuration Files

Relevant Test: https://github.com/hashicorp/terraform-provider-google/blob/efe355c1a6d781fee6d43624701217ae3a666e23/google/services/bigquery/resource_bigquery_dataset_test.go#L263-L313

Many are found here when attempting to bump from v1.5.0 -> v1.11.0 which is what led to some investigation into this

Expected Behavior

Tests should just pass as usual. They currently do but the moment we bump to v1.6.0 we run into ImportStateVerify issues

Actual Behavior

We run into ImportStateVerify errors that we didn't have previously. Here is just one example out of many:

2024-11-25T14:07:26.548-0800 [DEBUG] sdk.helper_resource: Started tfprotov5 provider instance server: test_step_number=4 test_name=TestAccBigQueryDataset_access test_terraform_path=/Users/mau/.asdf/shims/terraform test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest4044340386 tf_provider_addr=registry.terraform.io/hashicorp/google
2024/11/25 14:07:26 [DEBUG] [transport] [server-transport 0x14002b47380] Closing: EOF 
2024/11/25 14:07:26 [DEBUG] [transport] [server-transport 0x14000fd6b60] Closing: EOF 
2024/11/25 14:07:26 [DEBUG] [transport] [server-transport 0x14000fd6b60] loopyWriter exiting with error: transport closed by client 
2024-11-25T14:07:26.971-0800 [DEBUG] sdk.helper_resource: Stopping providers: test_name=TestAccBigQueryDataset_access test_terraform_path=/Users/mau/.asdf/shims/terraform test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest4044340386 test_step_number=4
2024-11-25T14:07:26.974-0800 [ERROR] sdk.helper_resource: Error running import: test_name=TestAccBigQueryDataset_access test_terraform_path=/Users/mau/.asdf/shims/terraform test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest4044340386 test_step_number=4
  error=
  | ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import.
  | 
  |   map[string]string{
  | - \t"access.0.iam_member":     "allUsers",
  | + \t"access.0.iam_member":     "",
  | - \t"access.0.role":           "READER",
  | + \t"access.0.role":           "OWNER",
  | - \t"access.0.user_by_email":  "",
  | + \t"access.0.user_by_email":  "[email protected]",
  | - \t"access.1.domain":         "hashicorp.com",
  | + \t"access.1.domain":         "",
  | - \t"access.1.iam_member":     "",
  | + \t"access.1.iam_member":     "allUsers",
  | + \t"access.2.domain":         "hashicorp.com",
  | + \t"access.2.group_by_email": "",
  | + \t"access.2.iam_member":     "",
  | - \t"access.2.role":           "OWNER",
  | + \t"access.2.role":           "READER",
  | + \t"access.2.special_group":  "",
  | - \t"access.2.user_by_email":  "[email protected]",
  | + \t"access.2.user_by_email":  "",
  |   }

Steps to Reproduce

To get past this we are setting these teststeps with ImportStateVerifyIgnore though this should be temporary.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions