From 554d00f2e90ace44a5110cb6ee3f091d152873d5 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 1 Apr 2020 14:41:20 -0700 Subject: [PATCH] command/e2etest: Update expected output for new plugin installer These tests make assertions against specific user-oriented output from the "terraform init" command, but we've intentionally changed some of these messages as part of introducing support for the decentralized provider namespace. --- command/e2etest/automation_test.go | 12 ++++++------ command/e2etest/init_test.go | 4 ++-- command/e2etest/primary_test.go | 4 ++-- command/e2etest/version_test.go | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/command/e2etest/automation_test.go b/command/e2etest/automation_test.go index a0914e7fe9..b5a8038bbb 100644 --- a/command/e2etest/automation_test.go +++ b/command/e2etest/automation_test.go @@ -40,11 +40,11 @@ func TestPlanApplyInAutomation(t *testing.T) { // Make sure we actually downloaded the plugins, rather than picking up // copies that might be already installed globally on the system. - if !strings.Contains(stdout, "- Downloading plugin for provider \"template") { + if !strings.Contains(stdout, "Installing registry.terraform.io/hashicorp/template v") { t.Errorf("template provider download message is missing from init output:\n%s", stdout) t.Logf("(this can happen if you have a copy of the plugin in one of the global plugin search dirs)") } - if !strings.Contains(stdout, "- Downloading plugin for provider \"null") { + if !strings.Contains(stdout, "Installing registry.terraform.io/hashicorp/null v") { t.Errorf("null provider download message is missing from init output:\n%s", stdout) t.Logf("(this can happen if you have a copy of the plugin in one of the global plugin search dirs)") } @@ -135,11 +135,11 @@ func TestAutoApplyInAutomation(t *testing.T) { // Make sure we actually downloaded the plugins, rather than picking up // copies that might be already installed globally on the system. - if !strings.Contains(stdout, "- Downloading plugin for provider \"template") { + if !strings.Contains(stdout, "Installing registry.terraform.io/hashicorp/template v") { t.Errorf("template provider download message is missing from init output:\n%s", stdout) t.Logf("(this can happen if you have a copy of the plugin in one of the global plugin search dirs)") } - if !strings.Contains(stdout, "- Downloading plugin for provider \"null") { + if !strings.Contains(stdout, "Installing registry.terraform.io/hashicorp/null v") { t.Errorf("null provider download message is missing from init output:\n%s", stdout) t.Logf("(this can happen if you have a copy of the plugin in one of the global plugin search dirs)") } @@ -202,11 +202,11 @@ func TestPlanOnlyInAutomation(t *testing.T) { // Make sure we actually downloaded the plugins, rather than picking up // copies that might be already installed globally on the system. - if !strings.Contains(stdout, "- Downloading plugin for provider \"template") { + if !strings.Contains(stdout, "Installing registry.terraform.io/hashicorp/template v") { t.Errorf("template provider download message is missing from init output:\n%s", stdout) t.Logf("(this can happen if you have a copy of the plugin in one of the global plugin search dirs)") } - if !strings.Contains(stdout, "- Downloading plugin for provider \"null") { + if !strings.Contains(stdout, "Installing registry.terraform.io/hashicorp/null v") { t.Errorf("null provider download message is missing from init output:\n%s", stdout) t.Logf("(this can happen if you have a copy of the plugin in one of the global plugin search dirs)") } diff --git a/command/e2etest/init_test.go b/command/e2etest/init_test.go index 918d19d466..1f3775bcb2 100644 --- a/command/e2etest/init_test.go +++ b/command/e2etest/init_test.go @@ -39,12 +39,12 @@ func TestInitProviders(t *testing.T) { t.Errorf("success message is missing from output:\n%s", stdout) } - if !strings.Contains(stdout, "- Downloading plugin for provider \"template\" (hashicorp/template)") { + if !strings.Contains(stdout, "- Installing registry.terraform.io/hashicorp/template v") { t.Errorf("provider download message is missing from output:\n%s", stdout) t.Logf("(this can happen if you have a copy of the plugin in one of the global plugin search dirs)") } - if !strings.Contains(stdout, "* provider.template: version = ") { + if !strings.Contains(stdout, "* registry.terraform.io/hashicorp/template: version = ") { t.Errorf("provider pinning recommendation is missing from output:\n%s", stdout) } diff --git a/command/e2etest/primary_test.go b/command/e2etest/primary_test.go index 3d0f859ac5..4a91eefdf0 100644 --- a/command/e2etest/primary_test.go +++ b/command/e2etest/primary_test.go @@ -38,11 +38,11 @@ func TestPrimarySeparatePlan(t *testing.T) { // Make sure we actually downloaded the plugins, rather than picking up // copies that might be already installed globally on the system. - if !strings.Contains(stdout, "- Downloading plugin for provider \"template") { + if !strings.Contains(stdout, "Installing registry.terraform.io/hashicorp/template v") { t.Errorf("template provider download message is missing from init output:\n%s", stdout) t.Logf("(this can happen if you have a copy of the plugin in one of the global plugin search dirs)") } - if !strings.Contains(stdout, "- Downloading plugin for provider \"null") { + if !strings.Contains(stdout, "Installing registry.terraform.io/hashicorp/null v") { t.Errorf("null provider download message is missing from init output:\n%s", stdout) t.Logf("(this can happen if you have a copy of the plugin in one of the global plugin search dirs)") } diff --git a/command/e2etest/version_test.go b/command/e2etest/version_test.go index e8bcdb01c1..261877290c 100644 --- a/command/e2etest/version_test.go +++ b/command/e2etest/version_test.go @@ -88,7 +88,7 @@ func TestVersionWithProvider(t *testing.T) { t.Errorf("unexpected stderr output:\n%s", stderr) } - wantMsg := "+ provider.template v" // we don't know which version we'll get here + wantMsg := "+ provider registry.terraform.io/hashicorp/template v" // we don't know which version we'll get here if !strings.Contains(stdout, wantMsg) { t.Errorf("output does not contain provider information %q:\n%s", wantMsg, stdout) }