opentofu/internal/cloud/e2e
Sebastian Rivera 9d7fdbea2d Handle -input=false in cloud integration
For non-interactive contexts, Terraform is typically executed with the flag -input=false.
However for runs that are not set to auto approve, the cloud integration will prompt a user for
approval input even with input being set to false. This commit enables the cloud integration to know
the value of the input flag and use it to determine whether or not to ask the user for input.

If -input is set to false and the run cannot be auto approved, the cloud integration will throw an error
stating run confirmation can no longer be handled in the CLI and that they must do so through the browser.
2022-04-26 11:17:44 -04:00
..
apply_auto_approve_test.go Upgrade go-tfe dependency to use 1.0 version. It contains breaking changes, so we are updating method signatures, method names and the type of optional parameters, as needed. (#30626) 2022-03-23 13:58:47 -07:00
apply_no_input_flag_test.go Handle -input=false in cloud integration 2022-04-26 11:17:44 -04:00
backend_apply_before_init_test.go Refactor cloud table test runs 2021-12-20 16:36:06 -06:00
env_variables_test.go Rename cloud env vars to use TF_CLOUD prefix 2022-04-20 14:34:53 -04:00
helper_test.go Cloud e2e tests for configuring with env vars 2022-04-11 15:19:17 -04:00
init_with_empty_tags_test.go Refactor cloud table test runs 2021-12-20 16:36:06 -06:00
main_test.go Cloud e2e tests for configuring with env vars 2022-04-11 15:19:17 -04:00
migrate_state_multi_to_tfc_test.go Upgrade go-tfe dependency to use 1.0 version. It contains breaking changes, so we are updating method signatures, method names and the type of optional parameters, as needed. (#30626) 2022-03-23 13:58:47 -07:00
migrate_state_remote_backend_to_tfc_test.go Upgrade go-tfe dependency to use 1.0 version. It contains breaking changes, so we are updating method signatures, method names and the type of optional parameters, as needed. (#30626) 2022-03-23 13:58:47 -07:00
migrate_state_single_to_tfc_test.go Upgrade go-tfe dependency to use 1.0 version. It contains breaking changes, so we are updating method signatures, method names and the type of optional parameters, as needed. (#30626) 2022-03-23 13:58:47 -07:00
migrate_state_tfc_to_other_test.go Refactor cloud table test runs 2021-12-20 16:36:06 -06:00
migrate_state_tfc_to_tfc_test.go Upgrade go-tfe dependency to use 1.0 version. It contains breaking changes, so we are updating method signatures, method names and the type of optional parameters, as needed. (#30626) 2022-03-23 13:58:47 -07:00
README.md remove build tags for cloud e2e 2021-11-11 16:33:26 -05:00
run_variables_test.go Refactor cloud table test runs 2021-12-20 16:36:06 -06:00

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> and TFE_HOSTNAME=<hostname>. The helpers for these tests require admin access to a TFC/TFE instance.
  • -timeout=30m. Some of these tests take longer than the default 10m timeout for go test.

Flags

  • Use the -v flag for normal verbose mode.
  • Use the -tfoutput flag to print the terraform output to standard out.
  • Use -ldflags to change the version Prerelease to match a version available remotely. Some behaviors rely on the exact local version Terraform being available in TFC/TFE, and manipulating the Prerelease during build is often the only way to ensure this. (More on -ldflags.)