You can configure HCP Terraform to automatically run tests for modules in your private registry. When enabled, HCP Terraform will run tests for every commit to the designated branch. This lets you verify that it is safe to publish new module versions.
If your module uses the branch-based publishing workflow and its source code includes tests, you can enable testing at any time.
To enable testing when you publish your module:
To enable testing after you publishing your branch-based module:
After publishing and enabling testing for your module, you can use the Terraform CLI locally to trigger remotely-executed tests in HCP Terraform. This lets you test your module changes using the credentials configured in HCP Terraform without committing your changes to version control.
To run your tests remotely, use the -cloud-run
flag with the path to your module in your private registry.
terraform test -cloud-run=app.terraform.io/:ORG/:MODULE_NAME/:PROVIDER
You can define test-specific environment variables that HCP Terraform will use for testing. If your tests provision infrastructure, you must configure provider credentials for the module.
To add environment variables to your module's tests:
TF_VAR_x
variables of a string type that are not defined in a config must be wrapped in double-quotes.You can define test-specific provider configurations for HCP Terraform to use while testing. For guidance on implementing test-specific provider configuration, refer to Terraform test.
Note: Generated module tests and are in public beta, and are available in HCP Terraform Plus and Premium editions. Refer to HCP Terraform pricing for details.
HCP Terraform can generate test files for any private module in your registry. You can only generate tests one time per module.
To generate tests for your module:
tests
directory in your configuration.tests
directory.Generated test files remain available on the module overview page for later retrieval. Click View test files to view and download any previously generated tests.
Organization owners can control this feature on the organization's General Settings page.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4