Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions utilities/pipelines/staticValidation/module.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Describe 'Readme tests' -Tag Readme {
if (-not ($convertedTemplates.Keys -contains $moduleFolderPathKey)) {
if (Test-Path (Join-Path $moduleFolderPath 'deploy.bicep')) {
$templateFilePath = Join-Path $moduleFolderPath 'deploy.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout --no-restore | ConvertFrom-Json -AsHashtable
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable

if (-not $templateContent) {
throw ($bicepTemplateCompilationFailedException -f $templateFilePath)
Expand Down Expand Up @@ -486,7 +486,7 @@ Describe 'Deployment template tests' -Tag Template {
if (-not ($convertedTemplates.Keys -contains $moduleFolderPathKey)) {
if (Test-Path (Join-Path $moduleFolderPath 'deploy.bicep')) {
$templateFilePath = Join-Path $moduleFolderPath 'deploy.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout --no-restore | ConvertFrom-Json -AsHashtable
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable

if (-not $templateContent) {
throw ($bicepTemplateCompilationFailedException -f $templateFilePath)
Expand Down Expand Up @@ -525,7 +525,7 @@ Describe 'Deployment template tests' -Tag Template {
if ((Split-Path $moduleTestFilePath -Extension) -eq '.json') {
$deploymentTestFile_AllParameterNames = ((Get-Content $moduleTestFilePath) | ConvertFrom-Json -AsHashtable).parameters.Keys | Sort-Object
} else {
$deploymentFileContent = az bicep build --file $moduleTestFilePath --stdout --no-restore | ConvertFrom-Json -AsHashtable
$deploymentFileContent = az bicep build --file $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$deploymentTestFile_AllParameterNames = $deploymentFileContent.resources[-1].properties.parameters.keys | Sort-Object # The last resource should be the test
}
$testFileTestCases += @{
Expand Down Expand Up @@ -986,7 +986,7 @@ Describe "API version tests [All apiVersions in the template should be 'recent']
if (-not ($convertedTemplates.Keys -contains $moduleFolderPathKey)) {
if (Test-Path (Join-Path $moduleFolderPath 'deploy.bicep')) {
$templateFilePath = Join-Path $moduleFolderPath 'deploy.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout --no-restore | ConvertFrom-Json -AsHashtable
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable

if (-not $templateContent) {
throw ($bicepTemplateCompilationFailedException -f $templateFilePath)
Expand Down
2 changes: 1 addition & 1 deletion utilities/tools/Set-ModuleReadMe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ function Set-ModuleReadMe {

if (-not $TemplateFileContent) {
if ((Split-Path -Path $TemplateFilePath -Extension) -eq '.bicep') {
$templateFileContent = az bicep build --file $TemplateFilePath --stdout --no-restore | ConvertFrom-Json -AsHashtable
$templateFileContent = az bicep build --file $TemplateFilePath --stdout | ConvertFrom-Json -AsHashtable
} else {
$templateFileContent = ConvertFrom-Json (Get-Content $TemplateFilePath -Encoding 'utf8' -Raw) -ErrorAction Stop -AsHashtable
}
Expand Down