From a6f63c489180218bad2f86b397b929e2e5bd2fe7 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Fri, 3 Apr 2020 13:59:42 -0700 Subject: [PATCH] command/e2etest: update "init" tests for abbreviated provider addresses We're now longer showing the default registry hostname as part of addresses coming from that registry. --- command/e2etest/automation_test.go | 12 ++++++------ command/e2etest/init_test.go | 10 +++++----- command/e2etest/primary_test.go | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/command/e2etest/automation_test.go b/command/e2etest/automation_test.go index b5a8038bb..af641a786 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, "Installing registry.terraform.io/hashicorp/template v") { + if !strings.Contains(stdout, "Installing 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, "Installing registry.terraform.io/hashicorp/null v") { + if !strings.Contains(stdout, "Installing 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, "Installing registry.terraform.io/hashicorp/template v") { + if !strings.Contains(stdout, "Installing 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, "Installing registry.terraform.io/hashicorp/null v") { + if !strings.Contains(stdout, "Installing 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, "Installing registry.terraform.io/hashicorp/template v") { + if !strings.Contains(stdout, "Installing 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, "Installing registry.terraform.io/hashicorp/null v") { + if !strings.Contains(stdout, "Installing 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 3031695a7..ca618fdce 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, "- Installing registry.terraform.io/hashicorp/template v") { + if !strings.Contains(stdout, "- Installing 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, "* registry.terraform.io/hashicorp/template: version = ") { + if !strings.Contains(stdout, "* hashicorp/template: version = ") { t.Errorf("provider pinning recommendation is missing from output:\n%s", stdout) } @@ -73,7 +73,7 @@ func TestInitProvidersInternal(t *testing.T) { t.Errorf("success message is missing from output:\n%s", stdout) } - if strings.Contains(stdout, "Installing registry.terraform.io/hashicorp/terraform") { + if strings.Contains(stdout, "Installing hashicorp/terraform") { // Shouldn't have downloaded anything with this config, because the // provider is built in. t.Errorf("provider download message appeared in output:\n%s", stdout) @@ -91,7 +91,7 @@ func TestInitProvidersVendored(t *testing.T) { // This test will try to reach out to registry.terraform.io as one of the // possible installation locations for - // registry.terraform.io/hashicorp/null, where it will find that + // hashicorp/null, where it will find that // versions do exist but will ultimately select the version that is // vendored due to the version constraint. skipIfCannotAccessNetwork(t) @@ -123,7 +123,7 @@ func TestInitProvidersVendored(t *testing.T) { t.Errorf("success message is missing from output:\n%s", stdout) } - if !strings.Contains(stdout, "- Installing registry.terraform.io/hashicorp/null v1.0.0+local") { + if !strings.Contains(stdout, "- Installing hashicorp/null v1.0.0+local") { 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)") } diff --git a/command/e2etest/primary_test.go b/command/e2etest/primary_test.go index 4a91eefdf..1cf39395f 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, "Installing registry.terraform.io/hashicorp/template v") { + if !strings.Contains(stdout, "Installing 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, "Installing registry.terraform.io/hashicorp/null v") { + if !strings.Contains(stdout, "Installing 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)") }