mirror of
https://github.com/hashicorp/terraform.git
synced 2026-02-03 20:50:59 -05:00
Some updates to staticcheck were catching more errors. Most of these were format functions without a format string, but rather than adding more exceptions I just fixed them all. This did also catch some incorrectly wrapped errors. |
||
|---|---|---|
| .. | ||
| apply_auto_approve_test.go | ||
| apply_no_input_flag_test.go | ||
| backend_apply_before_init_test.go | ||
| env_variables_test.go | ||
| helper_test.go | ||
| init_with_empty_tags_test.go | ||
| main_test.go | ||
| migrate_state_multi_to_tfc_test.go | ||
| migrate_state_remote_backend_to_tfc_test.go | ||
| migrate_state_single_to_tfc_test.go | ||
| migrate_state_tfc_to_other_test.go | ||
| migrate_state_tfc_to_tfc_test.go | ||
| README.md | ||
| run_variables_test.go | ||
How to run tests
To run them, use:
TFE_TOKEN=<token> TFE_HOSTNAME=<hostname> TF_ACC=1 go test ./internal/cloud/e2e/... -ldflags "-X \"github.com/hashicorp/terraform/version.Prerelease=<PRE-RELEASE>\""
Required flags
TF_ACC=1. This variable is used as part of terraform for tests that make external network calls. This is needed to run these tests. Without it, the tests do not run.TFE_TOKEN=<admin token>andTFE_HOSTNAME=<hostname>. The helpers for these tests require admin access to an HCP Terraform or Terraform Enterprise instance.-timeout=30m. Some of these tests take longer than the default 10m timeout forgo test.
Flags
- Use the
-vflag for normal verbose mode. - Use the
-tfoutputflag to print the terraform output to standard out. - Use
-ldflagsto change the version Prerelease to match a version available remotely. Some behaviors rely on the exact local version Terraform being available in HCP Terraform or Terraform Enterprise, and manipulating the Prerelease during build is often the only way to ensure this. (More on-ldflags.)