I’m working on improving an extending an existing Terraform provider and am running into difficulty in extending the test suite. I need to run update tests on a schema.TypeSet attribute and am having difficulty with the v1 testing SDK TestCheckResourceAttr() method. From what I’ve read schema.TypeSet attributes are stored internally as a hash with a numeric hash key, and to test the attributes that hash key needs to be referenced in the TestCheckResourceAttr() key argument. Based on the projects I’ve looked at most provider developers just bake the hash key in based on the test arguments.
I’m having difficulty, however, determining what that hash key should be. From what I’ve read common practice is to debug dump the test attribute state from within the test suite, but I’m having difficulty finding out how to dump the state inside a test. Can you please advise on how to determine a schema.TypeSet attribute hash key within a v1 test SDK test suite?