Skip to content

Commit

Permalink
fix: Updated Pester template test file check & added change to key va…
Browse files Browse the repository at this point in the history
…ult to enable republishing (#1236)

## Description

- Updated Pester template test file check 
- Added change to key vault to enable republishing
- Fixed incorrect conflict resolution of pe & max tests

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.key-vault.vault](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml/badge.svg?branch=users%2Falsehr%2Fe2eTestCheck&event=workflow_dispatch)](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml)
|

---------

Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com>
  • Loading branch information
AlexanderSehr and eriqua authored Mar 12, 2024
1 parent 46766a2 commit 6ac5dc7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 32 deletions.
4 changes: 2 additions & 2 deletions avm/res/key-vault/vault/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ module keyVault_secrets 'secret/main.bicep' = [for (secret, index) in secretList
name: secret.name
value: secret.value
keyVaultName: keyVault.name
attributesEnabled: secret.?attributesEnabled ?? true
attributesEnabled: secret.?attributesEnabled
attributesExp: secret.?attributesExp
attributesNbf: secret.?attributesNbf
contentType: secret.?contentType
Expand All @@ -223,7 +223,7 @@ module keyVault_keys 'key/main.bicep' = [for (key, index) in (keys ?? []): {
params: {
name: key.name
keyVaultName: keyVault.name
attributesEnabled: key.?attributesEnabled ?? true
attributesEnabled: key.?attributesEnabled
attributesExp: key.?attributesExp
attributesNbf: key.?attributesNbf
curveName: key.?curveName ?? 'P-256'
Expand Down
6 changes: 3 additions & 3 deletions avm/res/key-vault/vault/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "18302928297760675801"
"templateHash": "5604749365634791124"
},
"name": "Key Vaults",
"description": "This module deploys a Key Vault.",
Expand Down Expand Up @@ -1126,7 +1126,7 @@
"value": "[parameters('name')]"
},
"attributesEnabled": {
"value": "[coalesce(tryGet(variables('secretList')[copyIndex()], 'attributesEnabled'), true())]"
"value": "[tryGet(variables('secretList')[copyIndex()], 'attributesEnabled')]"
},
"attributesExp": {
"value": "[tryGet(variables('secretList')[copyIndex()], 'attributesExp')]"
Expand Down Expand Up @@ -1403,7 +1403,7 @@
"value": "[parameters('name')]"
},
"attributesEnabled": {
"value": "[coalesce(tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'attributesEnabled'), true())]"
"value": "[tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'attributesEnabled')]"
},
"attributesExp": {
"value": "[tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'attributesExp')]"
Expand Down
2 changes: 2 additions & 0 deletions avm/res/key-vault/vault/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,5 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
diagnosticDependencies
]
}]

output resourceId string = testDeployment[0].outputs.resourceId

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ Describe 'File/folder tests' -Tag 'Modules' {

$e2eTestFolderPathList = Get-ChildItem -Directory (Join-Path -Path $moduleFolderPath 'tests' 'e2e')
foreach ($e2eTestFolderPath in $e2eTestFolderPathList) {
$pathExisting = Test-Path (Join-Path -Path $e2eTestFolderPath 'main.test.bicep')
$pathExisting | Should -Be $true
$filePath = Join-Path -Path $e2eTestFolderPath 'main.test.bicep'
$pathExisting = Test-Path $filePath
$pathExisting | Should -Be $true -Because "path [$filePath] is expected to exist."
}
}
}
Expand Down Expand Up @@ -348,7 +349,7 @@ Describe 'Module tests' -Tag 'Module' {
}
}

It '[<moduleFolderName>] Compiled ARM template should be latest.' -TestCases $armTemplateTestCases {
It '[<moduleFolderName>] The [main.json] ARM template should be based on the current [main.bicep] Bicep template.' -TestCases $armTemplateTestCases {

param(
[string] $moduleFolderName,
Expand Down

0 comments on commit 6ac5dc7

Please sign in to comment.