Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post-refactor: fixing a couple of test failures #5267

Merged
merged 3 commits into from
Dec 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions azurerm/internal/acceptance/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package acceptance

import (
"fmt"
"os"
"testing"

"github.com/Azure/go-autorest/autorest/azure"
Expand Down Expand Up @@ -73,9 +74,9 @@ func BuildTestData(t *testing.T, resourceType string, resourceLabel string) Test
testData.Locations = availableLocations()
} else {
testData.Locations = Regions{
Primary: Location(),
Secondary: AltLocation(),
Ternary: AltLocation2(),
Primary: os.Getenv("ARM_TEST_LOCATION"),
Secondary: os.Getenv("ARM_TEST_LOCATION_ALT"),
Ternary: os.Getenv("ARM_TEST_LOCATION_ALT2"),
}
}

Expand Down
18 changes: 0 additions & 18 deletions azurerm/internal/acceptance/deprecated.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources"
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
Expand Down Expand Up @@ -40,10 +39,10 @@ func TestAccAzureRMContainerRegistryMigrateState(t *testing.T) {

client.StopContext = acceptance.AzureProvider.StopContext()

rs := acctest.RandString(7)
resourceGroupName := fmt.Sprintf("acctestRG%s", rs)
storageAccountName := fmt.Sprintf("acctestsa%s", rs)
location := azure.NormalizeLocation(acceptance.Location())
data := acceptance.BuildTestData(t, "azurerm_container_registry", "test")
resourceGroupName := fmt.Sprintf("acctestRG%s", data.RandomString)
storageAccountName := fmt.Sprintf("acctestsa%s", data.RandomString)
location := azure.NormalizeLocation(data.Locations.Primary)
ctx := client.StopContext

err = createResourceGroup(ctx, client, resourceGroupName, location)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func TestAccDataSourceAzureRMCosmosDBAccount_geoReplicated_customId(t *testing.T
Config: testAccDataSourceAzureRMCosmosDBAccount_geoReplicated_customId(data),
Check: resource.ComposeAggregateTestCheckFunc(
checkAccAzureRMCosmosDBAccount_basic(data, string(documentdb.BoundedStaleness), 2),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.0.location", acceptance.Location()),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.1.location", acceptance.AltLocation()),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.0.location", data.Locations.Primary),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.1.location", data.Locations.Secondary),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.0.failover_priority", "0"),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.1.failover_priority", "1"),
),
Expand Down Expand Up @@ -87,8 +87,8 @@ func TestAccDataSourceAzureRMCosmosDBAccount_complete(t *testing.T) {
resource.TestCheckResourceAttr(data.ResourceName, "ip_range_filter", "104.42.195.92,40.76.54.131,52.176.6.30,52.169.50.45/32,52.187.184.26,10.20.0.0/16"),
resource.TestCheckResourceAttr(data.ResourceName, "enable_automatic_failover", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "enable_multiple_write_locations", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.0.location", acceptance.Location()),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.1.location", acceptance.AltLocation()),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.0.location", data.Locations.Primary),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.1.location", data.Locations.Secondary),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.0.failover_priority", "0"),
resource.TestCheckResourceAttr(data.ResourceName, "geo_location.1.failover_priority", "1"),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ func TestAccAzureRMEventGridEventSubscription_basic(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMEventGridEventSubscriptionExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "event_delivery_schema", "EventGridSchema"),
resource.TestCheckResourceAttr(data.ResourceName, "storage_queue_endpoint.#", "1"),
resource.TestCheckResourceAttr(data.ResourceName, "storage_blob_dead_letter_destination.#", "1"),
resource.TestCheckResourceAttr(data.ResourceName, "included_event_types.0", "All"),
resource.TestCheckResourceAttr(data.ResourceName, "retry_policy.0.max_delivery_attempts", "11"),
resource.TestCheckResourceAttr(data.ResourceName, "retry_policy.0.event_time_to_live", "11"),
resource.TestCheckResourceAttr(data.ResourceName, "labels.0", "test"),
resource.TestCheckResourceAttr(data.ResourceName, "labels.2", "test2"),
),
},
data.ImportStep(),
Expand Down
Loading