From a75dcd4be01f27b188d7d1cf98d9fa1735dec11a Mon Sep 17 00:00:00 2001 From: James Bardin Date: Mon, 30 Nov 2020 12:28:37 -0500 Subject: [PATCH] warning are now in stdout --- command/e2etest/init_test.go | 6 +++--- command/e2etest/provider_dev_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/command/e2etest/init_test.go b/command/e2etest/init_test.go index 0f5e19b35..5e69951c3 100644 --- a/command/e2etest/init_test.go +++ b/command/e2etest/init_test.go @@ -373,13 +373,13 @@ func TestInitProviderWarnings(t *testing.T) { tf := e2e.NewBinary(terraformBin, fixturePath) defer tf.Close() - _, stderr, err := tf.Run("init") + stdout, _, err := tf.Run("init") if err == nil { t.Fatal("expected error, got success") } - if !strings.Contains(stderr, "This provider is archived and no longer needed. The terraform_remote_state\ndata source is built into the latest Terraform release.") { - t.Errorf("expected warning message is missing from output:\n%s", stderr) + if !strings.Contains(stdout, "This provider is archived and no longer needed. The terraform_remote_state\ndata source is built into the latest Terraform release.") { + t.Errorf("expected warning message is missing from output:\n%s", stdout) } } diff --git a/command/e2etest/provider_dev_test.go b/command/e2etest/provider_dev_test.go index 3c779c5a3..a31971535 100644 --- a/command/e2etest/provider_dev_test.go +++ b/command/e2etest/provider_dev_test.go @@ -62,7 +62,7 @@ func TestProviderDevOverrides(t *testing.T) { // to "install" them. This test is mimicking the a happy path of going // directly from "go build" to validate/plan/apply without interacting // with any registries, mirrors, lock files, etc. - stdout, stderr, err = tf.Run("validate") + stdout, _, err = tf.Run("validate") if err != nil { t.Fatalf("unexpected error: %s\n%s", err, stderr) } @@ -70,7 +70,7 @@ func TestProviderDevOverrides(t *testing.T) { if got, want := stdout, `The configuration is valid, but`; !strings.Contains(got, want) { t.Errorf("stdout doesn't include the success message\nwant: %s\n%s", want, got) } - if got, want := stderr, `Provider development overrides are in effect`; !strings.Contains(got, want) { + if got, want := stdout, `Provider development overrides are in effect`; !strings.Contains(got, want) { t.Errorf("stdout doesn't include the warning about development overrides\nwant: %s\n%s", want, got) } }