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.
This commit is contained in:
Martin Atkins 2020-04-01 14:41:20 -07:00
parent 0af09b23ca
commit 14d456372a
4 changed files with 11 additions and 11 deletions

View File

@ -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)")
}

View File

@ -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)
}

View File

@ -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)")
}

View File

@ -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)
}