no tests are executed and Terraform Compliance exits with AttributeError: 'dict' object has no attribute 'startswith', implying it tries to parse the references as a list of strings when it is a list of objects/dicts here.
To Reproduce
Feature File:
Bug happens independent of Feature File
❗ ERROR: Hook 'load_terraform_data' from /usr/local/lib/python3.7/site-packages/terraform_compliance/steps/terrain.py:9 raised: 'AttributeError: 'dict' object has no attribute 'startswith''
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/radish/hookregistry.py", line 132, in call
func(model, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/terraform_compliance/steps/terrain.py", line 11, in load_terraform_data
world.config.terraform = TerraformParser(world.config.user_data['plan_file'])
File "/usr/local/lib/python3.7/site-packages/terraform_compliance/extensions/terraform.py", line 60, in __init__
self.parse()
File "/usr/local/lib/python3.7/site-packages/terraform_compliance/extensions/terraform.py", line 567, in parse
self._mount_references()
File "/usr/local/lib/python3.7/site-packages/terraform_compliance/extensions/terraform.py", line 430, in _mount_references
if r.startswith('var'):
AttributeError: 'dict' object has no attribute 'startswith'
Description
I am using the Snowflake-Labs/snowflake provider and one of the resources breaks the parsing of the plan file.
I have attached a minimal example below but I highly suspect that the table_constraint is to blame. For foregin keys a
references
block is added:which clashes with the reference sections in the plan file terraform generates:
no tests are executed and Terraform Compliance exits with
AttributeError: 'dict' object has no attribute 'startswith'
, implying it tries to parse the references as a list of strings when it is a list of objects/dicts here.To Reproduce
Feature File: Bug happens independent of Feature File
Plan File:
Sample Terraform Code:
Used
terraform-compliance
Parameters:Running via Docker: Yes
Error Output:
Expected Behavior:
The tests are executed normally
Tested Versions:
1.3.45
v1.5.6
Additional Context: