Skip to content

Commit

Permalink
Moved test files
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSehr committed Sep 22, 2023
1 parent 30af01e commit c460b9f
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 82 deletions.
32 changes: 16 additions & 16 deletions .github/actions/templates/avm-validateModulePester/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,42 @@
## ACTION PARAMETERS ##
##-------------------------------------------##
##
## |==================================================================================================================================================|
## | Parameter | Required | Default | Description | Example |
## |--------------------------|----------|---------|--------------------------------------|-----------------------------------------------------------|
## | modulePath | true | '' | The path to the module's folder | 'modules/api-management/service' |
## | moduleTestFilePath | true | '' | The path to the module Pester tests. | 'utilities/pipelines/staticValidation/module.tests.ps1' |
## |==================================================================================================================================================|
## |===========================================================================================================================================================|
## | Parameter | Required | Default | Description | Example |
## |--------------------------|----------|---------|--------------------------------------|--------------------------------------------------------------------|
## | modulePath | true | '' | The path to the module's folder | 'modules/api-management/service' |
## | moduleTestFilePath | true | '' | The path to the module Pester tests. | 'utilities/pipelines/staticValidation/compliance/module.tests.ps1' |
## |===========================================================================================================================================================|
##
##---------------------------------------------##

name: 'Execute Pester module tests'
description: 'Execute Pester module tests (if any)'
name: "Execute Pester module tests"
description: "Execute Pester module tests (if any)"

inputs:
modulePath:
description: "The path to the module's folder"
required: true
default: ''
default: ""
moduleTestFilePath:
description: 'The path to the test file'
description: "The path to the test file"
required: true
default: ''
default: "avm/utilities/pipelines/staticValidation/compliance/module.tests.ps1"

runs:
using: 'composite'
using: "composite"
steps:
# [Module Pester Test] task(s)
#-----------------------------
- name: 'Run Pester tests'
- name: "Run Pester tests"
id: pester_run_step
shell: pwsh
run: |
# Grouping task logs
Write-Output '::group::Run Pester tests'
# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'avm' 'utilities' 'pipelines' 'staticValidation' 'Set-PesterGitHubOutput.ps1')
. (Join-Path $env:GITHUB_WORKSPACE 'avm' 'utilities' 'pipelines' 'staticValidation' 'compliance' 'Set-PesterGitHubOutput.ps1')
# Set repo root path
$repoRootPath = $env:GITHUB_WORKSPACE
Expand Down Expand Up @@ -86,7 +86,7 @@ runs:
$pesterConfiguration = @{
Run = @{
Container = New-PesterContainer -Path (Join-Path $repoRootPath $moduleTestFilePath) -Data @{
moduleFolderPaths = $moduleFolderPaths
moduleFolderPaths = $moduleFolderPaths
# tokenConfiguration = $tokenConfiguration
# allowPreviewVersionsInAPITests = [System.Convert]::ToBoolean('${{ env.allowPreviewVersionsInAPITests }}')
}
Expand Down Expand Up @@ -120,7 +120,7 @@ runs:
Write-Output ('{0}={1}' -f 'formattedPesterResultsPath', $functionInput.outputFilePath) >> $env:GITHUB_OUTPUT
- name: 'Output to GitHub job summaries'
- name: "Output to GitHub job summaries"
if: always()
shell: pwsh
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/avm.template.module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
uses: ./.github/actions/templates/avm-validateModulePester
with:
modulePath: '${{ inputs.modulePath }}'
moduleTestFilePath: '${{ env.moduleTestFilePath }}'

#########################
# PSRule validation #
Expand Down
2 changes: 1 addition & 1 deletion avm/res/cognitive-services/account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ param restrictOutboundNetworkAccess bool = true
@description('Optional. The storage accounts for this resource.')
param userOwnedStorage array = []

@description('Optional. The managed identity definition for this resource')
@description('Optional. The managed identity definition for this resource.')
param managedIdentities managedIdentitiesType

@description('Optional. Enable/Disable usage telemetry for module.')
Expand Down
53 changes: 36 additions & 17 deletions avm/res/cognitive-services/account/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.21.1.54444",
"templateHash": "2011438504132117881"
"templateHash": "12649951839001498344"
},
"name": "Cognitive Services",
"description": "This module deploys a Cognitive Service.",
Expand Down Expand Up @@ -390,6 +390,31 @@
}
},
"nullable": true
},
"lockType": {
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. Specify the name of lock."
}
},
"kind": {
"type": "string",
"allowedValues": [
"CanNotDelete",
"None",
"ReadOnly"
],
"nullable": true,
"metadata": {
"description": "Optional. Specify the type of lock."
}
}
},
"nullable": true
}
},
"parameters": {
Expand Down Expand Up @@ -501,15 +526,9 @@
}
},
"lock": {
"type": "string",
"defaultValue": "",
"allowedValues": [
"",
"CanNotDelete",
"ReadOnly"
],
"$ref": "#/definitions/lockType",
"metadata": {
"description": "Optional. Specify the type of lock."
"description": "Optional. The lock settings of the service."
}
},
"roleAssignments": {
Expand Down Expand Up @@ -590,7 +609,7 @@
"managedIdentities": {
"$ref": "#/definitions/managedIdentitiesType",
"metadata": {
"description": "Optional. The managed identity definition for this resource"
"description": "Optional. The managed identity definition for this resource."
}
},
"enableTelemetry": {
Expand Down Expand Up @@ -720,14 +739,14 @@
]
},
"cognitiveService_lock": {
"condition": "[not(empty(parameters('lock')))]",
"condition": "[and(not(empty(coalesce(parameters('lock'), createObject()))), not(equals(tryGet(parameters('lock'), 'kind'), 'None')))]",
"type": "Microsoft.Authorization/locks",
"apiVersion": "2020-05-01",
"scope": "[format('Microsoft.CognitiveServices/accounts/{0}', parameters('name'))]",
"name": "[format('{0}-{1}-lock', parameters('name'), parameters('lock'))]",
"name": "[coalesce(tryGet(parameters('lock'), 'name'), format('lock-{0}', parameters('name')))]",
"properties": {
"level": "[parameters('lock')]",
"notes": "[if(equals(parameters('lock'), 'CanNotDelete'), 'Cannot delete resource or child resources.', 'Cannot modify the resource or child resources.')]"
"level": "[coalesce(tryGet(parameters('lock'), 'kind'), '')]",
"notes": "[if(equals(tryGet(parameters('lock'), 'kind'), 'CanNotDelete'), 'Cannot delete resource or child resources.', 'Cannot delete or modify the resource or child resources.')]"
},
"dependsOn": [
"cognitiveService"
Expand Down Expand Up @@ -848,7 +867,7 @@
"_generator": {
"name": "bicep",
"version": "0.21.1.54444",
"templateHash": "15547486634180132508"
"templateHash": "13438182834931170603"
},
"name": "Private Endpoints",
"description": "This module deploys a Private Endpoint.",
Expand Down Expand Up @@ -1158,7 +1177,7 @@
"condition": "[not(empty(parameters('privateDnsZoneResourceIds')))]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "[format('{0}-PrivateEndpoint-PrivateDnsZoneGroup', uniqueString(deployment().name, parameters('location')))]",
"name": "[format('{0}-PrivateEndpoint-PrivateDnsZoneGroup', uniqueString(deployment().name))]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
Expand Down Expand Up @@ -1328,7 +1347,7 @@
},
"value": "[reference('cognitiveService').endpoint]"
},
"systemAssignedPrincipalId": {
"systemAssignedMIPrincipalId": {
"type": "string",
"metadata": {
"description": "The principal ID of the system assigned identity."
Expand Down
Loading

0 comments on commit c460b9f

Please sign in to comment.