Skip to content

Commit

Permalink
[Modules] Added itempotency to tests [4/5] (#4213)
Browse files Browse the repository at this point in the history
* Updated batch 4

* Refreshed NW

* Test update to vnet

* Update to latest

* Refreshed templates

* Update to latest
  • Loading branch information
AlexanderSehr authored Nov 18, 2023
1 parent d6a3486 commit fed1f33
Show file tree
Hide file tree
Showing 133 changed files with 557 additions and 457 deletions.
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": "5940192377706231381"
"version": "0.23.1.45101",
"templateHash": "2444407542563544390"
},
"name": "Application Gateway Web Application Firewall (WAF) Policies",
"description": "This module deploys an Application Gateway Web Application Firewall (WAF) Policy.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2022-09-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'
Expand Down Expand Up @@ -69,4 +70,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2022-09-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'
Expand Down Expand Up @@ -69,4 +70,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ module diagnosticDependencies '../../../../../.shared/.templates/diagnostic.depe

var appGWName = '${namePrefix}${serviceShort}001'
var appGWExpectedResourceID = '${resourceGroup.id}/providers/Microsoft.Network/applicationGateways/${appGWName}'
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: appGWName
Expand Down Expand Up @@ -495,4 +496,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ module diagnosticDependencies '../../../../../.shared/.templates/diagnostic.depe

var appGWName = '${namePrefix}${serviceShort}001'
var appGWExpectedResourceID = '${resourceGroup.id}/providers/Microsoft.Network/applicationGateways/${appGWName}'
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: appGWName
Expand Down Expand Up @@ -495,4 +496,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
4 changes: 2 additions & 2 deletions modules/network/application-security-group/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": "5654528138086993351"
"version": "0.23.1.45101",
"templateHash": "4261949823005751944"
},
"name": "Application Security Groups (ASG)",
"description": "This module deploys an Application Security Group (ASG).",
Expand Down
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' = {
Role: 'DeploymentValidation'
}
}
}
}]
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' = {
Role: 'DeploymentValidation'
}
}
}
}]
12 changes: 6 additions & 6 deletions modules/network/azure-firewall/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": "3800476164049795980"
"version": "0.23.1.45101",
"templateHash": "13795244529737704006"
},
"name": "Azure Firewalls",
"description": "This module deploys an Azure Firewall.",
Expand Down Expand Up @@ -536,8 +536,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "18404193892947466906"
"version": "0.23.1.45101",
"templateHash": "15536304828480480757"
},
"name": "Public IP Addresses",
"description": "This module deploys a Public IP Address.",
Expand Down Expand Up @@ -1067,8 +1067,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "18404193892947466906"
"version": "0.23.1.45101",
"templateHash": "15536304828480480757"
},
"name": "Public IP Addresses",
"description": "This module deploys a Public IP Address.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,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 @@ -75,4 +76,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,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 @@ -99,4 +100,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,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'
vNetId: nestedDependencies.outputs.virtualNetworkResourceId
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,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 @@ -64,4 +65,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,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 @@ -57,4 +58,4 @@ module testDeployment '../../../main.bicep' = {
}
}
}
}
}]
7 changes: 4 additions & 3 deletions modules/network/azure-firewall/tests/e2e/max/main.test.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 @@ -187,4 +188,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
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 @@ -187,4 +188,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
8 changes: 4 additions & 4 deletions modules/network/bastion-host/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": "387274338478290784"
"version": "0.23.1.45101",
"templateHash": "18247198571712055537"
},
"name": "Bastion Hosts",
"description": "This module deploys a Bastion Host.",
Expand Down Expand Up @@ -456,8 +456,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "18404193892947466906"
"version": "0.23.1.45101",
"templateHash": "15536304828480480757"
},
"name": "Public IP Addresses",
"description": "This module deploys a Public IP Address.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,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 @@ -104,4 +105,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,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'
vNetId: nestedDependencies.outputs.virtualNetworkResourceId
}
}
}]
7 changes: 4 additions & 3 deletions modules/network/bastion-host/tests/e2e/max/main.test.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 @@ -102,4 +103,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
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 @@ -102,4 +103,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Loading

0 comments on commit fed1f33

Please sign in to comment.