Skip to content

Commit

Permalink
[Modules] Added itempotency to tests [1/5] (#4210)
Browse files Browse the repository at this point in the history
* Updated test cases of batch 1

* Updated test templates

* Update to latest

* Undid non-working changes

* Refreshed json
  • Loading branch information
AlexanderSehr authored Nov 18, 2023
1 parent 033260f commit d38096f
Show file tree
Hide file tree
Showing 88 changed files with 360 additions and 283 deletions.
4 changes: 2 additions & 2 deletions modules/analysis-services/server/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "17464709928355207715"
"version": "0.23.1.45101",
"templateHash": "11444956126966610005"
},
"name": "Analysis Services Servers",
"description": "This module deploys an Analysis Services Server.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}'
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ module diagnosticDependencies '../../../../../.shared/.templates/diagnostic.depe
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}'
Expand Down Expand Up @@ -117,4 +118,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ module diagnosticDependencies '../../../../../.shared/.templates/diagnostic.depe
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}'
Expand Down Expand Up @@ -117,4 +118,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
publisherEmail: '[email protected]'
publisherName: '${namePrefix}-az-amorg-x-001'
}
}
}]
7 changes: 4 additions & 3 deletions modules/api-management/service/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ module diagnosticDependencies '../../../../../.shared/.templates/diagnostic.depe
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand Down Expand Up @@ -216,4 +217,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ module diagnosticDependencies '../../../../../.shared/.templates/diagnostic.depe
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand Down Expand Up @@ -216,4 +217,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ module nestedDependencies 'dependencies.bicep' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand Down Expand Up @@ -96,4 +97,4 @@ module testDeployment '../../../main.bicep' = {
userAssignedIdentityResourceId: nestedDependencies.outputs.managedIdentityResourceId
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ module diagnosticDependencies '../../../../../.shared/.templates/diagnostic.depe
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand Down Expand Up @@ -121,4 +122,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ module nestedDependencies 'dependencies.bicep' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand Down Expand Up @@ -74,4 +75,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ module diagnosticDependencies '../../../../../.shared/.templates/diagnostic.depe
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand Down Expand Up @@ -121,4 +122,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
7 changes: 4 additions & 3 deletions modules/app/container-app/tests/e2e/defaults/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ module nestedDependencies 'dependencies.bicep' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
tags: {
Expand All @@ -71,4 +72,4 @@ module testDeployment '../../../main.bicep' = {
}
]
}
}
}]
7 changes: 4 additions & 3 deletions modules/app/container-app/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ module nestedDependencies 'dependencies.bicep' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
tags: {
Expand Down Expand Up @@ -106,4 +107,4 @@ module testDeployment '../../../main.bicep' = {
}
]
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ module nestedDependencies 'dependencies.bicep' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
tags: {
Expand Down Expand Up @@ -106,4 +107,4 @@ module testDeployment '../../../main.bicep' = {
}
]
}
}
}]
4 changes: 2 additions & 2 deletions modules/app/managed-environment/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "5686402227763337334"
"version": "0.23.1.45101",
"templateHash": "17510800738142190994"
},
"name": "App ManagedEnvironments",
"description": "This module deploys an App Managed Environment (also known as a Container App Environment).",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ module nestedDependencies 'dependencies.bicep' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
logAnalyticsWorkspaceResourceId: nestedDependencies.outputs.logAnalyticsWorkspaceResourceId
}
}
}]
7 changes: 4 additions & 3 deletions modules/app/managed-environment/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ module nestedDependencies 'dependencies.bicep' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand All @@ -69,4 +70,4 @@ module testDeployment '../../../main.bicep' = {
Env: 'test'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ module nestedDependencies 'dependencies.bicep' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand All @@ -69,4 +70,4 @@ module testDeployment '../../../main.bicep' = {
Env: 'test'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ module nestedDependencies 'dependencies.bicep' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand All @@ -65,4 +66,4 @@ module testDeployment '../../../main.bicep' = {
]
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ module diagnosticDependencies '../../../../../.shared/.templates/diagnostic.depe
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand Down Expand Up @@ -258,4 +259,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Loading

0 comments on commit d38096f

Please sign in to comment.