Skip to content

Commit

Permalink
Only running the tests if the environment variables present
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Aug 29, 2017
1 parent bd7ce17 commit e814616
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions azurerm/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/Azure/go-autorest/autorest/azure"
"github.com/davecgh/go-spew/spew"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
)
Expand Down Expand Up @@ -83,10 +84,17 @@ func testArmEnvironment() (*azure.Environment, error) {
return &env, nil
}

func TestAzureRMResourceProviderRegistration(t *testing.T) {
testAccPreCheck(t)

func TestAccAzureRMResourceProviderRegistration(t *testing.T) {
environment := testArmEnvironmentName()

if os.Getenv(resource.TestEnvVar) == "" {
t.Skip(fmt.Sprintf(
"Integration test skipped unless env '%s' set",
resource.TestEnvVar))
return
}

// we deliberately don't use the main config - since we care about
config := Config{
SubscriptionID: os.Getenv("ARM_SUBSCRIPTION_ID"),
ClientID: os.Getenv("ARM_CLIENT_ID"),
Expand Down

0 comments on commit e814616

Please sign in to comment.