Merge pull request #26412 from OwenTuz/issue-26411-fix-failing-e2e-test-provider-not-found

Fix bad string match that was causing TestInitProviderNotFound to fail
This commit is contained in:
Pam Selle 2020-10-02 10:43:18 -04:00 committed by GitHub
commit 1817c8ac3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -358,7 +358,7 @@ func TestInitProviderNotFound(t *testing.T) {
t.Fatal("expected error, got success")
}
if !strings.Contains(stderr, "provider registry.terraform.io/hashicorp/nonexist was not\nfound in any of the search locations\n\n- "+pluginDir) {
if !strings.Contains(stderr, "provider registry.terraform.io/hashicorp/nonexist was not\nfound in any of the search locations\n\n - "+pluginDir) {
t.Errorf("expected error message is missing from output:\n%s", stderr)
}
})

View File

@ -511,7 +511,7 @@ func (c *InitCommand) getProviders(config *configs.Config, state *states.State,
sources := errorTy.Sources
displaySources := make([]string, len(sources))
for i, source := range sources {
displaySources[i] = fmt.Sprintf("- %s", source)
displaySources[i] = fmt.Sprintf(" - %s", source)
}
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,