-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from hashicorp/paultyng-patch-1
Add package docs for binary test driver
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package acctest | ||
|
||
// Package acctest provides the ability to opt in to the new binary test driver. The binary | ||
// test driver allows you to run your acceptance tests with a binary of Terraform instead of | ||
// an emulated version packaged inside the SDK. This allows for a number of important | ||
// enhancements, but most notably a more realistic testing experience and matrix testing | ||
// against multiple versions of Terraform CLI. This also allows the SDK to be completely | ||
// separated, at a dependency level, from the Terraform CLI, as long as it is >= 0.12.0 | ||
// | ||
// The new test driver must be enabled by initialising the test helper in your TestMain | ||
// function in all provider packages that run acceptance tests. Most providers have only | ||
// one package. | ||
// | ||
// In v2 of the SDK, the binary test driver will be mandatory. | ||
// | ||
// After importing this package, you can add code similar to the following: | ||
// | ||
// func TestMain(m *testing.M) { | ||
// acctest.UseBinaryDriver("provider_name", Provider) | ||
// resource.TestMain(m) | ||
// } | ||
// Where `Provider` is the function that returns the instance of a configured `terraform.ResourceProvider` | ||
// Some providers already have a TestMain defined, usually for the purpose of enabling test | ||
// sweepers. These additional occurrences should be removed. | ||
// | ||
// Initialising the binary test helper using UseBinaryDriver causes all tests to be run using | ||
// the new binary driver. Until SDK v2, the DisableBinaryDriver boolean property can be used | ||
// to use the legacy test driver for an individual TestCase. | ||
// | ||
// It is no longer necessary to import other Terraform providers as Go modules: these | ||
// imports should be removed. |