mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Update user-facing references to Terraform internal/command/e2etest
(#91)
Signed-off-by: Marcin Białoń <mbialon@spacelift.io>
This commit is contained in:
parent
3b5b8ba719
commit
90f23d19b6
@ -236,9 +236,9 @@ func TestPlanOnlyInAutomation(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Because we're running with TF_IN_AUTOMATION set, we should not see
|
// Because we're running with TF_IN_AUTOMATION set, we should not see
|
||||||
// any mention of the the "terraform apply" command in the output.
|
// any mention of the the "opentf apply" command in the output.
|
||||||
if strings.Contains(stdout, "terraform apply") {
|
if strings.Contains(stdout, "opentf apply") {
|
||||||
t.Errorf("unwanted mention of \"terraform apply\" in plan output\n%s", stdout)
|
t.Errorf("unwanted mention of \"opentf apply\" in plan output\n%s", stdout)
|
||||||
}
|
}
|
||||||
|
|
||||||
if tf.FileExists("tfplan") {
|
if tf.FileExists("tfplan") {
|
||||||
|
@ -58,7 +58,7 @@ func TestInitProvidersInternal(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
// This test should _not_ reach out anywhere because the "terraform"
|
// This test should _not_ reach out anywhere because the "terraform"
|
||||||
// provider is internal to the core terraform binary.
|
// provider is internal to the core opentf binary.
|
||||||
|
|
||||||
fixturePath := filepath.Join("testdata", "terraform-provider")
|
fixturePath := filepath.Join("testdata", "terraform-provider")
|
||||||
tf := e2e.NewBinary(t, terraformBin, fixturePath)
|
tf := e2e.NewBinary(t, terraformBin, fixturePath)
|
||||||
@ -145,7 +145,7 @@ func TestInitProvidersLocalOnly(t *testing.T) {
|
|||||||
fixturePath := filepath.Join("testdata", "local-only-provider")
|
fixturePath := filepath.Join("testdata", "local-only-provider")
|
||||||
tf := e2e.NewBinary(t, terraformBin, fixturePath)
|
tf := e2e.NewBinary(t, terraformBin, fixturePath)
|
||||||
// If you run this test on a workstation with a plugin-cache directory
|
// If you run this test on a workstation with a plugin-cache directory
|
||||||
// configured, it will leave a bad directory behind and terraform init will
|
// configured, it will leave a bad directory behind and opentf init will
|
||||||
// not work until you remove it.
|
// not work until you remove it.
|
||||||
//
|
//
|
||||||
// To avoid this, we will "zero out" any existing cli config file.
|
// To avoid this, we will "zero out" any existing cli config file.
|
||||||
|
@ -43,7 +43,7 @@ func setup() func() {
|
|||||||
var err error
|
var err error
|
||||||
terraformBin, err = filepath.Abs(terraformBin)
|
terraformBin, err = filepath.Abs(terraformBin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Sprintf("failed to find absolute path of terraform executable: %s", err))
|
panic(fmt.Sprintf("failed to find absolute path of opentf executable: %s", err))
|
||||||
}
|
}
|
||||||
return func() {}
|
return func() {}
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,10 @@ import (
|
|||||||
|
|
||||||
// The tests in this file are for the "primary workflow", which includes
|
// The tests in this file are for the "primary workflow", which includes
|
||||||
// variants of the following sequence, with different details:
|
// variants of the following sequence, with different details:
|
||||||
// terraform init
|
// opentf init
|
||||||
// terraform plan
|
// opentf plan
|
||||||
// terraform apply
|
// opentf apply
|
||||||
// terraform destroy
|
// opentf destroy
|
||||||
|
|
||||||
func TestPrimarySeparatePlan(t *testing.T) {
|
func TestPrimarySeparatePlan(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
@ -67,11 +67,11 @@ func TestProviderDevOverrides(t *testing.T) {
|
|||||||
t.Errorf("configuration should depend on %s, but doesn't\n%s", want, got)
|
t.Errorf("configuration should depend on %s, but doesn't\n%s", want, got)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: We're intentionally not running "terraform init" here, because
|
// NOTE: We're intentionally not running "opentf init" here, because
|
||||||
// dev overrides are always ready to use and don't need any special action
|
// dev overrides are always ready to use and don't need any special action
|
||||||
// to "install" them. This test is mimicking the a happy path of going
|
// to "install" them. This test is mimicking the a happy path of going
|
||||||
// directly from "go build" to validate/plan/apply without interacting
|
// directly from "go build" to validate/plan/apply without interacting
|
||||||
// with any registries, mirrors, lock files, etc. To verify "terraform
|
// with any registries, mirrors, lock files, etc. To verify "opentf
|
||||||
// init" does actually show a warning, that behavior is tested at the end.
|
// init" does actually show a warning, that behavior is tested at the end.
|
||||||
stdout, stderr, err = tf.Run("validate")
|
stdout, stderr, err = tf.Run("validate")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -38,7 +38,7 @@ func TestProviderProtocols(t *testing.T) {
|
|||||||
simpleProvider := filepath.Join(tf.WorkDir(), "terraform-provider-simple")
|
simpleProvider := filepath.Join(tf.WorkDir(), "terraform-provider-simple")
|
||||||
simpleProviderExe := e2e.GoBuild("github.com/placeholderplaceholderplaceholder/opentf/internal/provider-simple/main", simpleProvider)
|
simpleProviderExe := e2e.GoBuild("github.com/placeholderplaceholderplaceholder/opentf/internal/provider-simple/main", simpleProvider)
|
||||||
|
|
||||||
// Move the provider binaries into a directory that we will point terraform
|
// Move the provider binaries into a directory that we will point opentf
|
||||||
// to using the -plugin-dir cli flag.
|
// to using the -plugin-dir cli flag.
|
||||||
platform := getproviders.CurrentPlatform.String()
|
platform := getproviders.CurrentPlatform.String()
|
||||||
hashiDir := "cache/registry.terraform.io/hashicorp/"
|
hashiDir := "cache/registry.terraform.io/hashicorp/"
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
"github.com/placeholderplaceholderplaceholder/opentf/internal/e2e"
|
"github.com/placeholderplaceholderplaceholder/opentf/internal/e2e"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The tests in this file are for the "terraform providers mirror" command,
|
// The tests in this file are for the "opentf providers mirror" command,
|
||||||
// which is tested in an e2etest mode rather than a unit test mode because it
|
// which is tested in an e2etest mode rather than a unit test mode because it
|
||||||
// interacts directly with Terraform Registry and the full details of that are
|
// interacts directly with Terraform Registry and the full details of that are
|
||||||
// tricky to mock. Such a mock is _possible_, but we're using e2etest as a
|
// tricky to mock. Such a mock is _possible_, but we're using e2etest as a
|
||||||
|
@ -15,7 +15,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// TestProviderTampering tests various ways that the provider plugins in the
|
// TestProviderTampering tests various ways that the provider plugins in the
|
||||||
// local cache directory might be modified after an initial "terraform init",
|
// local cache directory might be modified after an initial "opentf init",
|
||||||
// which other Terraform commands which use those plugins should catch and
|
// which other Terraform commands which use those plugins should catch and
|
||||||
// report early.
|
// report early.
|
||||||
func TestProviderTampering(t *testing.T) {
|
func TestProviderTampering(t *testing.T) {
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/placeholderplaceholderplaceholder/opentf/internal/e2e"
|
"github.com/placeholderplaceholderplaceholder/opentf/internal/e2e"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestProvisionerPlugin is a test that terraform can execute a 3rd party
|
// TestProvisionerPlugin is a test that opentf can execute a 3rd party
|
||||||
// provisioner plugin.
|
// provisioner plugin.
|
||||||
func TestProvisionerPlugin(t *testing.T) {
|
func TestProvisionerPlugin(t *testing.T) {
|
||||||
if !canRunGoBuild {
|
if !canRunGoBuild {
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/placeholderplaceholderplaceholder/opentf/internal/e2e"
|
"github.com/placeholderplaceholderplaceholder/opentf/internal/e2e"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestProviderDevOverrides is a test that terraform can execute a 3rd party
|
// TestProviderDevOverrides is a test that opentf can execute a 3rd party
|
||||||
// provisioner plugin.
|
// provisioner plugin.
|
||||||
func TestProvisioner(t *testing.T) {
|
func TestProvisioner(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
@ -26,9 +26,9 @@ import (
|
|||||||
|
|
||||||
// The tests in this file are for the "unmanaged provider workflow", which
|
// The tests in this file are for the "unmanaged provider workflow", which
|
||||||
// includes variants of the following sequence, with different details:
|
// includes variants of the following sequence, with different details:
|
||||||
// terraform init
|
// opentf init
|
||||||
// terraform plan
|
// opentf plan
|
||||||
// terraform apply
|
// opentf apply
|
||||||
//
|
//
|
||||||
// These tests are run against an in-process server, and checked to make sure
|
// These tests are run against an in-process server, and checked to make sure
|
||||||
// they're not trying to control the lifecycle of the binary. They are not
|
// they're not trying to control the lifecycle of the binary. They are not
|
||||||
|
Loading…
Reference in New Issue
Block a user