warning are now in stdout

This commit is contained in:
James Bardin 2020-11-30 12:28:37 -05:00
parent 0c3bb316ea
commit a75dcd4be0
2 changed files with 5 additions and 5 deletions

View File

@ -373,13 +373,13 @@ func TestInitProviderWarnings(t *testing.T) {
tf := e2e.NewBinary(terraformBin, fixturePath) tf := e2e.NewBinary(terraformBin, fixturePath)
defer tf.Close() defer tf.Close()
_, stderr, err := tf.Run("init") stdout, _, err := tf.Run("init")
if err == nil { if err == nil {
t.Fatal("expected error, got success") 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.") { 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", stderr) t.Errorf("expected warning message is missing from output:\n%s", stdout)
} }
} }

View File

@ -62,7 +62,7 @@ func TestProviderDevOverrides(t *testing.T) {
// 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. // with any registries, mirrors, lock files, etc.
stdout, stderr, err = tf.Run("validate") stdout, _, err = tf.Run("validate")
if err != nil { if err != nil {
t.Fatalf("unexpected error: %s\n%s", err, stderr) 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) { 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) 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) t.Errorf("stdout doesn't include the warning about development overrides\nwant: %s\n%s", want, got)
} }
} }