github.com/hashicorp/terraform-plugin-sdk@v1.17.2/acctest/doc.go (about)

     1  // Package acctest provides the ability to opt in to the new binary test driver. The binary
     2  // test driver allows you to run your acceptance tests with a binary of Terraform instead of
     3  // an emulated version packaged inside the SDK. This allows for a number of important
     4  // enhancements, but most notably a more realistic testing experience and matrix testing
     5  // against multiple versions of Terraform CLI. This also allows the SDK to be completely
     6  // separated, at a dependency level, from the Terraform CLI, as long as it is >= 0.12.0
     7  //
     8  // The new test driver must be enabled by initialising the test helper in your TestMain
     9  // function in all provider packages that run acceptance tests. Most providers have only
    10  // one package.
    11  //
    12  // In v2 of the SDK, the binary test driver will be mandatory.
    13  //
    14  // After importing this package, you can add code similar to the following:
    15  //
    16  //   func TestMain(m *testing.M) {
    17  //     acctest.UseBinaryDriver("provider_name", Provider)
    18  //     resource.TestMain(m)
    19  //   }
    20  //
    21  // Where `Provider` is the function that returns the instance of a configured `terraform.ResourceProvider`
    22  // Some providers already have a TestMain defined, usually for the purpose of enabling test
    23  // sweepers. These additional occurrences should be removed.
    24  //
    25  // Initialising the binary test helper using UseBinaryDriver causes all tests to be run using
    26  // the new binary driver. Until SDK v2, the DisableBinaryDriver boolean property can be used
    27  // to use the legacy test driver for an individual TestCase.
    28  //
    29  // It is no longer necessary to import other Terraform providers as Go modules: these
    30  // imports should be removed.
    31  package acctest