Skip to content

Commit

Permalink
update deploy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-taylor committed Dec 6, 2023
1 parent 6116873 commit 2c46f48
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/subscription/subscriptionDeploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

var billingScope = os.Getenv("AZURE_BILLING_SCOPE")
var tenantId = os.Getenv("AZURE_TENANT_ID")

// TestDeploySubscriptionAliasValid tests the deployment of a subscription alias
// with valid input variables.
Expand Down Expand Up @@ -71,7 +72,7 @@ func TestDeploySubscriptionAliasValidAzApi(t *testing.T) {
require.NoError(t, err)
defer test.Cleanup()

check.InPlan(test.PlanStruct).NumberOfResourcesEquals(3).ErrorIsNil(t)
check.InPlan(test.PlanStruct).NumberOfResourcesEquals(4).ErrorIsNil(t)

// Defer the cleanup of the subscription alias to the end of the test.
// Should be run after the Terraform destroy.
Expand Down Expand Up @@ -185,6 +186,10 @@ func TestDeploySubscriptionAliasManagementGroupValidAzApi(t *testing.T) {

err = azureutils.IsSubscriptionInManagementGroup(t, u, v["subscription_management_group_id"].(string))
assert.NoErrorf(t, err, "subscription %s is not in management group %s", sid, v["subscription_management_group_id"].(string))

if err := azureutils.SetSubscriptionManagementGroup(u, tenantId); err != nil {
t.Logf("cannot move subscription to tenant root group: %v", err)
}
}

// getValidInputVariables returns a set of valid input variables that can be used and modified for testing scenarios.
Expand Down

0 comments on commit 2c46f48

Please sign in to comment.