-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Problem Statement
The test framework today expects test configuration in the form of a string. This is a convention nearly all official providers comply with.
This approach makes it difficult, or rather impossible to parse test configs outside the context of a test framework, which in turn prevents us from:
- collecting any data about test infrastructure, e.g. to estimate how much it costs to run all acceptance tests
- knowing how many and which tests cover specific resource or data source
- formatting configs via
terraform fmt - upgrading configs via
terraform 0.12upgrade - and otherwise take advantage of any other tooling that users have available to them when dealing with raw HCL
It is technically possible to move these inlined strings into files, but we have no conventions in that area and no API surface helping with this.
Extra Context
One of the motivating factors behind this design was (probably?) to allow developers to easily generate many different versions of the same config by leveraging common Go tooling such as fmt.Sprintf or text/template.
It is expected that this requirement isn't going away and we need to find a solution that allows for such templating, e.g. via new 0.12 templatefile function or through other means.
Proposal
Come up with a convention for directory structure on how to structure configs and allow test framework to load valid files from there without providers having to deal with any low-level IO functions.