diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b72f2dcd..9f8a8e95 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -6,6 +6,9 @@ The following are certain Google Provider-specific things to be aware of when co ## Go +See the root [README](../README.md) for information on which version of Go you need to use the provider. Generally, this will +be the latest stable release of Go. + We aim to make the Google Provider a good steward of Go practices. See https://github.com/golang/go/wiki/CodeReviewComments for common Go mistakes that you should attempt to avoid. ## Autogenerated Resources @@ -30,28 +33,34 @@ If you're developing against Magic Modules, vendoring changes is done automatica ### Running Tests -The following environment variables must be set in order to run tests: +Configuring tests is similar to configuring the provider; see the [Provider Configuration Reference](https://www.terraform.io/docs/providers/google/provider_reference.html#configuration-reference) for more details. The following environment variables must be set in order to run tests: + ``` GOOGLE_PROJECT -GOOGLE_CREDENTIALS or GOOGLE_USE_DEFAULT_CREDENTIALS -``` -For certain tests, the following variables may also need to be set: -``` +GOOGLE_CREDENTIALS GOOGLE_REGION +GOOGLE_ZONE +``` + +To ensure that your tests are performed in a region and zone with wide support for GCP feature, `GOOGLE_REGION` should be set to `us-central1` and `GOOGLE_ZONE` to `us-central1-a`. + +For certain tests, primarily those involving project creation, the following variables may also need to be set. Most tests do +not require their being set: + +``` GOOGLE_ORG GOOGLE_BILLING_ACCOUNT ``` -The only region we support running tests in right now is `us-central1` - some products that are tested here are only available in a few regions, and the only region that all products are available in is `us-central1`. +To run a specific test, use `TESTARGS`, such as in: -To run a specific test, use a command such as: ``` make testacc TEST=./google TESTARGS='-run=TestAccContainerNodePool_basic' ``` The `TESTARGS` variable is regexp-like, so multiple tests can be run in parallel by specifying a common substring of those tests (for example, `TestAccContainerNodePool` to run all node pool tests). -To run all tests, you can simply omit the `TESTARGS` argument - but please keep in mind that that is quite a few tests and will take quite a long time and create some fairly expensive resources. It usually is not advisable to run all tests. +To run all tests, you can omit the `TESTARGS` argument - but please keep in mind that that is quite a few tests and will take quite a long time and create some fairly expensive resources. It usually is not advisable to run all tests. ### Writing Tests