Skip to content

Commit

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

* Update to latest

* Refreshed outdated template

* Missing refresh

* Refrehsed readme

* Refrehsed readme

* Update to latest
  • Loading branch information
AlexanderSehr authored Nov 18, 2023
1 parent fed1f33 commit 0dbb4ec
Show file tree
Hide file tree
Showing 110 changed files with 457 additions and 362 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,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 @@ -306,4 +307,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@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'
}
}
}]
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 @@ -234,4 +235,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 @@ -234,4 +235,4 @@ module testDeployment '../../../main.bicep' = {
}
]
}
}
}]
4 changes: 2 additions & 2 deletions modules/operations-management/solution/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "2318608107759137473"
"version": "0.23.1.45101",
"templateHash": "6590935071601965866"
},
"name": "Operations Management Solutions",
"description": "This module deploys an Operations Management Solution.",
Expand Down
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: 'Updates'
logAnalyticsWorkspaceName: nestedDependencies.outputs.logAnalyticsWorkspaceName
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ 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: 'AzureAutomation'
logAnalyticsWorkspaceName: nestedDependencies.outputs.logAnalyticsWorkspaceName
product: 'OMSGallery'
publisher: 'Microsoft'
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ 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'
logAnalyticsWorkspaceName: nestedDependencies.outputs.logAnalyticsWorkspaceName
product: 'nonmsTestSolutionProduct'
publisher: 'nonmsTestSolutionPublisher'
}
}
}]
10 changes: 5 additions & 5 deletions modules/policy-insights/remediation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ module remediation 'br:bicep/modules/policy-insights.remediation:1.0.0' = {

```bicep
module remediation 'br:bicep/modules/policy-insights.remediation:1.0.0' = {
name: '${uniqueString(deployment().name)}-test-pirmgmin'
name: '${uniqueString(deployment().name, location)}-test-pirmgmin'
params: {
// Required parameters
name: 'pirmgmin001'
Expand Down Expand Up @@ -170,7 +170,7 @@ module remediation 'br:bicep/modules/policy-insights.remediation:1.0.0' = {

```bicep
module remediation 'br:bicep/modules/policy-insights.remediation:1.0.0' = {
name: '${uniqueString(deployment().name)}-test-pirrgcom'
name: '${uniqueString(deployment().name, location)}-test-pirrgcom'
params: {
// Required parameters
name: 'pirrgcom001'
Expand Down Expand Up @@ -251,7 +251,7 @@ module remediation 'br:bicep/modules/policy-insights.remediation:1.0.0' = {

```bicep
module remediation 'br:bicep/modules/policy-insights.remediation:1.0.0' = {
name: '${uniqueString(deployment().name)}-test-pirrgmin'
name: '${uniqueString(deployment().name, location)}-test-pirrgmin'
params: {
// Required parameters
name: 'pirrgmin001'
Expand Down Expand Up @@ -300,7 +300,7 @@ module remediation 'br:bicep/modules/policy-insights.remediation:1.0.0' = {

```bicep
module remediation 'br:bicep/modules/policy-insights.remediation:1.0.0' = {
name: '${uniqueString(deployment().name)}-test-pirsubcom'
name: '${uniqueString(deployment().name, location)}-test-pirsubcom'
params: {
// Required parameters
name: 'pirsubcom001'
Expand Down Expand Up @@ -381,7 +381,7 @@ module remediation 'br:bicep/modules/policy-insights.remediation:1.0.0' = {

```bicep
module remediation 'br:bicep/modules/policy-insights.remediation:1.0.0' = {
name: '${uniqueString(deployment().name)}-test-pirsubmin'
name: '${uniqueString(deployment().name, location)}-test-pirsubmin'
params: {
// Required parameters
name: 'pirsubmin001'
Expand Down
16 changes: 8 additions & 8 deletions modules/policy-insights/remediation/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "4742101117506662139"
"version": "0.23.1.45101",
"templateHash": "9716129657217536595"
},
"name": "Policy Insights Remediations",
"description": "This module deploys a Policy Insights Remediation.",
Expand Down Expand Up @@ -179,8 +179,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "9807832589850582654"
"version": "0.23.1.45101",
"templateHash": "11915278545941211218"
},
"name": "Policy Insights Remediations (Management Group scope)",
"description": "This module deploys a Policy Insights Remediation on a Management Group scope.",
Expand Down Expand Up @@ -375,8 +375,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "8491362450892267233"
"version": "0.23.1.45101",
"templateHash": "15638854500024270747"
},
"name": "Policy Insights Remediations (Subscription scope)",
"description": "This module deploys a Policy Insights Remediation on a Subscription scope.",
Expand Down Expand Up @@ -571,8 +571,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.22.6.54827",
"templateHash": "1603868954809777625"
"version": "0.23.1.45101",
"templateHash": "6808524543119403982"
},
"name": "Policy Insights Remediations (Resource Group scope)",
"description": "This module deploys a Policy Insights Remediation on a Resource Group scope.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2021-06-
// Test Execution //
// ============== //

module testDeployment '../../../management-group/main.bicep' = {
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
@batchSize(1)
module testDeployment '../../../management-group/main.bicep' = [for iteration in [ 'init', 'idem' ]: {
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand All @@ -96,4 +97,4 @@ module testDeployment '../../../management-group/main.bicep' = {
parallelDeployments: 1
failureThresholdPercentage: '0.5'
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ resource policyAssignment 'Microsoft.Authorization/policyAssignments@2021-06-01'
// Test Execution //
// ============== //

module testDeployment '../../../management-group/main.bicep' = {
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
@batchSize(1)
module testDeployment '../../../management-group/main.bicep' = [for iteration in [ 'init', 'idem' ]: {
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
policyAssignmentId: policyAssignment.id
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2021-06-
// Test Execution //
// ============== //

module testDeployment '../../../resource-group/main.bicep' = {
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
@batchSize(1)
module testDeployment '../../../resource-group/main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand All @@ -106,4 +107,4 @@ module testDeployment '../../../resource-group/main.bicep' = {
parallelDeployments: 1
failureThresholdPercentage: '0.5'
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ resource policyAssignment 'Microsoft.Authorization/policyAssignments@2021-06-01'
// Test Execution //
// ============== //

module testDeployment '../../../resource-group/main.bicep' = {
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
@batchSize(1)
module testDeployment '../../../resource-group/main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
policyAssignmentId: policyAssignment.id
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2021-06-
// Test Execution //
// ============== //

module testDeployment '../../../subscription/main.bicep' = {
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
@batchSize(1)
module testDeployment '../../../subscription/main.bicep' = [for iteration in [ 'init', 'idem' ]: {
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
Expand All @@ -96,4 +97,4 @@ module testDeployment '../../../subscription/main.bicep' = {
parallelDeployments: 1
failureThresholdPercentage: '0.5'
}
}
}]
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ resource policyAssignment 'Microsoft.Authorization/policyAssignments@2021-06-01'
// Test Execution //
// ============== //

module testDeployment '../../../subscription/main.bicep' = {
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
@batchSize(1)
module testDeployment '../../../subscription/main.bicep' = [for iteration in [ 'init', 'idem' ]: {
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
policyAssignmentId: policyAssignment.id
}
}
}]
4 changes: 2 additions & 2 deletions modules/power-bi-dedicated/capacity/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": "5834334564189406991"
"version": "0.23.1.45101",
"templateHash": "14660488048974784902"
},
"name": "Power BI Dedicated Capacities",
"description": "This module deploys a Power BI Dedicated Capacity.",
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 @@ -57,4 +58,4 @@ module testDeployment '../../../main.bicep' = {
nestedDependencies.outputs.managedIdentityPrincipalId
]
}
}
}]
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 @@ -73,4 +74,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 @@ -73,4 +74,4 @@ module testDeployment '../../../main.bicep' = {
Role: 'DeploymentValidation'
}
}
}
}]
Loading

0 comments on commit 0dbb4ec

Please sign in to comment.