Overview of the Better Tests POC package
mainThe bettertestspoc package provides a framework of helpers designed to make acceptance tests for the Snowflake Terraform provider quicker, more readable, and more pleasant to implement. It focuses on two main areas: automated assertions and improved configuration modeling.
Core Packages
assert package
This package contains all assertion logic and utilities for building assertions for new objects. Most assertions are currently generated. Supported assertion types include:
- Snowflake object assertions: Located in the
objectassertsubpackage. - Snowflake object parameters assertions: Located in the
objectparametersassertsubpackage. - Resource assertions: Located in the
resourceassertsubpackage. - Resource parameters assertions: Located in the
resourceparametersassertsubpackage. - Describe / show output assertions: Located in the
resourceshowoutputassertsubpackage.
config package
This package provides model abstractions to improve how configuration is prepared in acceptance tests. It is designed to be more readable and reusable than using hardcoded strings in Config: or using ConfigFile: for files that are not directly reachable from the test body. The following models are available and are already generated:
ResourceModelDatasourceModelProviderModel