Skip to content

Commit

Permalink
Test: Add features {} to the provider block
Browse files Browse the repository at this point in the history
  • Loading branch information
magodo committed Dec 23, 2024
1 parent 021a08d commit 95cfcc1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ func TestAccRoleManagementPolicyDataSource_resource(t *testing.T) {

func (RoleManagementPolicyDataSource) managementGroup(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {}
provider "azurerm" {
features {}
}
data "azurerm_client_config" "current" {
}
Expand All @@ -94,7 +96,9 @@ data "azurerm_role_management_policy" "test" {

func (RoleManagementPolicyDataSource) resourceGroup(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-%[1]s"
Expand All @@ -115,7 +119,9 @@ data "azurerm_role_management_policy" "test" {

func (RoleManagementPolicyDataSource) subscription(data acceptance.TestData) string {
return `
provider "azurerm" {}
provider "azurerm" {
features {}
}
data "azurerm_subscription" "test" {}
Expand All @@ -133,7 +139,9 @@ data "azurerm_role_management_policy" "test" {

func (RoleManagementPolicyDataSource) resource(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-%[1]s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ func (RoleManagementPolicyResource) Exists(ctx context.Context, clients *clients

func (RoleManagementPolicyResource) managementGroup(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {}
provider "azurerm" {
features {}
}
provider "azuread" {}
Expand Down Expand Up @@ -245,7 +247,9 @@ resource "azurerm_role_management_policy" "test" {

func (RoleManagementPolicyResource) resourceGroupTemplate(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-%[1]s"
Expand Down Expand Up @@ -345,7 +349,9 @@ resource "azurerm_role_management_policy" "test" {

func (RoleManagementPolicyResource) subscriptionTemplate(data acceptance.TestData) string {
return `
provider "azurerm" {}
provider "azurerm" {
features {}
}
data "azurerm_subscription" "test" {}
Expand Down Expand Up @@ -484,7 +490,9 @@ resource "azurerm_role_management_policy" "test" {

func (RoleManagementPolicyResource) resourceTemplate(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-%[1]s"
Expand Down
17 changes: 13 additions & 4 deletions internal/services/storage/storage_blob_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,9 @@ func (r StorageBlobResource) blobMatchesContent(kind blobs.BlobType, expectedCon
func (r StorageBlobResource) appendEmpty(data acceptance.TestData) string {
template := r.template(data, "private")
return fmt.Sprintf(`
provider "azurerm" {}
provider "azurerm" {
features {}
}
%s
Expand All @@ -673,7 +675,9 @@ resource "azurerm_storage_blob" "test" {
func (r StorageBlobResource) appendEmptyMetaData(data acceptance.TestData) string {
template := r.template(data, "private")
return fmt.Sprintf(`
provider "azurerm" {}
provider "azurerm" {
features {}
}
%s
Expand All @@ -693,7 +697,9 @@ resource "azurerm_storage_blob" "test" {
func (r StorageBlobResource) blockEmpty(data acceptance.TestData) string {
template := r.template(data, "private")
return fmt.Sprintf(`
provider "azurerm" {}
provider "azurerm" {
features {}
}
%s
Expand All @@ -710,6 +716,7 @@ func (r StorageBlobResource) blockEmptyAzureADAuth(data acceptance.TestData) str
template := r.template(data, "private")
return fmt.Sprintf(`
provider "azurerm" {
features {}
storage_use_azuread = true
}
Expand Down Expand Up @@ -1407,7 +1414,9 @@ resource "azurerm_storage_container" "test" {
func (r StorageBlobResource) archive(data acceptance.TestData) string {
template := r.template(data, "private")
return fmt.Sprintf(`
provider "azurerm" {}
provider "azurerm" {
features {}
}
%s
Expand Down

0 comments on commit 95cfcc1

Please sign in to comment.