Skip to content

Commit

Permalink
mark functional test for parallel run (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
vhvb1989 authored Aug 25, 2022
1 parent 7a4da44 commit e74b5fc
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cli/azd/test/functional/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ func Test_CLI_Init_AsksForSubscriptionIdAndCreatesEnvAndProjectFile(t *testing.T
}

func Test_CLI_Init_CanUseTemplate(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
ctx, cancel := newTestContext(t)
defer cancel()

Expand All @@ -135,30 +137,40 @@ func Test_CLI_Init_CanUseTemplate(t *testing.T) {

// Test when we have multiple resource group matches. More than one rg has azd-env-name set
func Test_CLI_ResourceGroupNameWithMultipleMatches(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
envName := randomEnvName()
Internal_Test_CLI_ResourceGroupsName(t, envName, fmt.Sprintf("rg-%s", envName), true, true, true)
}

// Test when we can't find any resource group matches
func Test_CLI_ResourceGroupNameWithoutMatch(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
envName := randomEnvName()
Internal_Test_CLI_ResourceGroupsName(t, envName, fmt.Sprintf("rg-%s", envName), true, false, false)
}

// Test when resource group uses rg- prefix
func Test_CLI_ResourceGroupNameWithPrefix(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
envName := randomEnvName()
Internal_Test_CLI_ResourceGroupsName(t, envName, fmt.Sprintf("rg-%s", envName), true, true, false)
}

// Test when resource group uses -rg suffix
func Test_CLI_ResourceGroupNameWithSuffix(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
envName := randomEnvName()
Internal_Test_CLI_ResourceGroupsName(t, envName, fmt.Sprintf("%s-rg", envName), true, true, false)
}

// Test when we don't have any resource groups with azd-env-name tag
func Test_CLI_ResourceGroupNameWithoutEnvNameTag(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
envName := randomEnvName()
Internal_Test_CLI_ResourceGroupsName(t, envName, fmt.Sprintf("rg-%s", envName), false, true, false)
}
Expand Down Expand Up @@ -229,6 +241,8 @@ func Internal_Test_CLI_ResourceGroupsName(t *testing.T, envName string, rgName s
}

func Test_CLI_InfraCreateAndDelete(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
ctx, cancel := newTestContext(t)
defer cancel()

Expand Down Expand Up @@ -272,6 +286,8 @@ func Test_CLI_InfraCreateAndDelete(t *testing.T) {
}

func Test_CLI_InfraCreateAndDeleteUpperCase(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
ctx, cancel := newTestContext(t)
defer cancel()

Expand Down Expand Up @@ -315,6 +331,8 @@ func Test_CLI_InfraCreateAndDeleteUpperCase(t *testing.T) {
}

func Test_CLI_InfraCreateAndDeleteWebApp(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
ctx, cancel := newTestContext(t)
defer cancel()

Expand Down Expand Up @@ -400,6 +418,8 @@ func Test_CLI_InfraCreateAndDeleteWebApp(t *testing.T) {

// test for azd deploy, azd deploy --service
func Test_CLI_DeployInvalidName(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
ctx, cancel := newTestContext(t)
defer cancel()

Expand All @@ -424,6 +444,8 @@ func Test_CLI_DeployInvalidName(t *testing.T) {
}

func Test_CLI_RestoreCommand(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
ctx, cancel := newTestContext(t)
defer cancel()

Expand Down Expand Up @@ -451,6 +473,8 @@ func Test_CLI_RestoreCommand(t *testing.T) {
}

func Test_CLI_InfraCreateAndDeleteFuncApp(t *testing.T) {
// running this test in parallel is ok as it uses a t.TempDir()
t.Parallel()
ctx, cancel := newTestContext(t)
defer cancel()

Expand Down

0 comments on commit e74b5fc

Please sign in to comment.