Skip to content

Commit

Permalink
Merge pull request #5113 from terraform-providers/b/fixing-tests
Browse files Browse the repository at this point in the history
provider: ensuring the providers slice isn't a nil pointer
  • Loading branch information
tombuildsstuff authored Dec 9, 2019
2 parents 6b7f24e + 7c38f24 commit 52065c7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions azurerm/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ var testAccProvider *schema.Provider

func init() {
azureProvider := Provider().(*schema.Provider)
supportedProviders := map[string]terraform.ResourceProvider{
"azurerm": testAccProvider,
"azuread": azuread.Provider().(*schema.Provider),
}

// TODO: these can be de-duped once this is relocated
testAccProvider = azureProvider
acceptance.AzureProvider = azureProvider
testAccProviders = supportedProviders
acceptance.SupportedProviders = supportedProviders

// NOTE: these /cannot/ be simplified into a single shared variable (tried, it causes a nil-slice)
testAccProviders = map[string]terraform.ResourceProvider{
"azurerm": testAccProvider,
"azuread": azuread.Provider().(*schema.Provider),
}
acceptance.SupportedProviders = map[string]terraform.ResourceProvider{
"azurerm": testAccProvider,
"azuread": azuread.Provider().(*schema.Provider),
}
}

func TestProvider(t *testing.T) {
Expand Down

0 comments on commit 52065c7

Please sign in to comment.