github.com/graywolf-at-work-2/terraform-vendor@v1.4.5/internal/cloud/e2e/README.md (about) 1 # How to run tests 2 3 To run them, use: 4 ``` 5 TFE_TOKEN=<token> TFE_HOSTNAME=<hostname> TF_ACC=1 go test ./internal/cloud/e2e/... -ldflags "-X \"github.com/hashicorp/terraform/version.Prerelease=<PRE-RELEASE>\"" 6 ``` 7 8 Required flags 9 * `TF_ACC=1`. This variable is used as part of terraform for tests that make 10 external network calls. This is needed to run these tests. Without it, the 11 tests do not run. 12 * `TFE_TOKEN=<admin token>` and `TFE_HOSTNAME=<hostname>`. The helpers 13 for these tests require admin access to a TFC/TFE instance. 14 * `-timeout=30m`. Some of these tests take longer than the default 10m timeout for `go test`. 15 16 ### Flags 17 18 * Use the `-v` flag for normal verbose mode. 19 * Use the `-tfoutput` flag to print the terraform output to standard out. 20 * Use `-ldflags` to change the version Prerelease to match a version 21 available remotely. Some behaviors rely on the exact local version Terraform 22 being available in TFC/TFE, and manipulating the Prerelease during build is 23 often the only way to ensure this. 24 [(More on `-ldflags`.)](https://www.digitalocean.com/community/tutorials/using-ldflags-to-set-version-information-for-go-applications)