Skip to content

Commit

Permalink
add additional test for logs config
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops committed Jan 21, 2022
1 parent f014fd7 commit 0fae3a5
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
34 changes: 34 additions & 0 deletions internal/services/appservice/linux_function_app_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,14 @@ func TestAccLinuxFunctionApp_appServiceLoggingUpdate(t *testing.T) {
),
},
data.ImportStep(),
{
Config: r.appServiceLogsWithRetention(data, SkuStandardPlan),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("kind").HasValue("functionapp,linux"),
),
},
data.ImportStep(),
{
Config: r.basic(data, SkuStandardPlan),
Check: acceptance.ComposeTestCheckFunc(
Expand Down Expand Up @@ -1169,6 +1177,32 @@ provider "azurerm" {
%s
resource "azurerm_linux_function_app" "test" {
name = "acctest-LFA-%d"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
service_plan_id = azurerm_service_plan.test.id
storage_account_name = azurerm_storage_account.test.name
storage_account_access_key = azurerm_storage_account.test.primary_access_key
site_config {
app_service_logs {
disk_quota_mb = 25
}
}
}
`, r.template(data, planSku), data.RandomInteger)
}

func (r LinuxFunctionAppResource) appServiceLogsWithRetention(data acceptance.TestData, planSku string) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
%s
resource "azurerm_linux_function_app" "test" {
name = "acctest-LFA-%d"
location = azurerm_resource_group.test.location
Expand Down
34 changes: 34 additions & 0 deletions internal/services/appservice/windows_function_app_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,14 @@ func TestAccWindowsFunctionApp_appServiceLoggingUpdate(t *testing.T) {
),
},
data.ImportStep(),
{
Config: r.appServiceLogsWithRetention(data, SkuStandardPlan),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("kind").HasValue("functionapp"),
),
},
data.ImportStep(),
{
Config: r.basic(data, SkuStandardPlan),
Check: acceptance.ComposeTestCheckFunc(
Expand Down Expand Up @@ -1544,6 +1552,32 @@ provider "azurerm" {
%s
resource "azurerm_windows_function_app" "test" {
name = "acctest-WFA-%d"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
service_plan_id = azurerm_service_plan.test.id
storage_account_name = azurerm_storage_account.test.name
storage_account_access_key = azurerm_storage_account.test.primary_access_key
site_config {
app_service_logs {
disk_quota_mb = 25
}
}
}
`, r.template(data, planSku), data.RandomInteger)
}

func (r WindowsFunctionAppResource) appServiceLogsWithRetention(data acceptance.TestData, planSku string) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
%s
resource "azurerm_windows_function_app" "test" {
name = "acctest-WFA-%d"
location = azurerm_resource_group.test.location
Expand Down

0 comments on commit 0fae3a5

Please sign in to comment.