From 577de2c4dbddf402fe801ebe7f625416d34c843a Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Thu, 7 Sep 2023 10:52:48 +0200 Subject: [PATCH 1/3] Fixed param ref --- utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 b/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 index f295039a82..82cf12b42e 100644 --- a/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 +++ b/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 @@ -37,7 +37,7 @@ BeforeAll { Describe 'Test default behavior' -Tag 'Default' { BeforeAll { - ConvertTo-ARMTemplate -Path $rootPath -Verbose -RunSynchronous + ConvertTo-ARMTemplate -RootPath $rootPath -Verbose -RunSynchronous } It 'All [] top-level [main.bicep] files are converted to [main.json]' { @@ -90,7 +90,7 @@ Describe 'Test default behavior' -Tag 'Default' { Describe 'Test flag to including children' -Tag 'ConvertChildren' { BeforeAll { - ConvertTo-ARMTemplate -Path $rootPath -ConvertChildren -Verbose -RunSynchronous + ConvertTo-ARMTemplate -RootPath $rootPath -ConvertChildren -Verbose -RunSynchronous } It 'All [] [main.bicep] files are converted to [main.json]' { @@ -143,7 +143,7 @@ Describe 'Test flag to including children' -Tag 'ConvertChildren' { Describe 'Test flags that skip logic' -Tag 'Skip' { BeforeAll { - ConvertTo-ARMTemplate -Path $rootPath -SkipBicepCleanUp -SkipMetadataCleanup -SkipPipelineUpdate -Verbose -RunSynchronous + ConvertTo-ARMTemplate -RootPath $rootPath -SkipBicepCleanUp -SkipMetadataCleanup -SkipPipelineUpdate -Verbose -RunSynchronous } It 'All [] main.bicep files are converted to main.json' { From 7dcaf6d3aa5e3fd105000b9848f83467045eef25 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Thu, 7 Sep 2023 11:05:21 +0200 Subject: [PATCH 2/3] Removed test for a parameter that isn't supported anymore --- .../tests/ConvertTo-ARMTemplate.Tests.ps1 | 53 ------------------- 1 file changed, 53 deletions(-) diff --git a/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 b/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 index 82cf12b42e..c991acb586 100644 --- a/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 +++ b/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 @@ -87,59 +87,6 @@ Describe 'Test default behavior' -Tag 'Default' { } } -Describe 'Test flag to including children' -Tag 'ConvertChildren' { - - BeforeAll { - ConvertTo-ARMTemplate -RootPath $rootPath -ConvertChildren -Verbose -RunSynchronous - } - - It 'All [] [main.bicep] files are converted to [main.json]' { - $deployJsonFilesCount = (Get-ChildItem -Recurse $modulesFolderPath | Where-Object { $_.FullName -match 'main.json' }).Count - $deployJsonFilesCount | Should -Be $allBicepDeployFilesCount - } - - It 'All [] [main.test.bicep] files are converted to [main.test.json]' { - $deployJsonFilesCount = (Get-ChildItem -Recurse $modulesFolderPath | Where-Object { $_.FullName -match 'main.test.json' }).Count - $deployJsonFilesCount | Should -Be $bicepTestFilesCount - } - - It 'All bicep files are removed' { - $actualBicepFilesCount = (Get-ChildItem -Recurse $modulesFolderPath | Where-Object { $_.FullName -match '.*.bicep' }).Count - $actualBicepFilesCount | Should -Be 0 - } - - It 'All json files have metadata removed' { - $releveantJSONFiles = (Get-ChildItem -Recurse $modulesFolderPath).FullName | Where-Object { $_ -match '.+(main.json|main.test.json)$' } - - $metadataFound = $false - - foreach ($deployJsonFile in $deployJsonFiles) { - $TemplateObject = Get-Content -Path $deployJsonFile -Raw | ConvertFrom-Json -AsHashtable - - if ([bool]($TemplateObject.Keys -contains 'metadata')) { - $metadataFound = $true - break - } - } - - $metadataFound | Should -Be $false - } - - It 'All [] GitHub workflow files are updated' { - $moduleWorkflowFilesUpdated = 0 - - foreach ($workFlowFile in $moduleWorkflowFiles) { - foreach ($line in (Get-Content -Path $workFlowFile.FullName)) { - if ($line -like '*templateFilePath:*.json*') { - $moduleWorkflowFilesUpdated += 1 - break - } - } - } - $moduleWorkflowFilesUpdated | Should -Be $originalModuleWorkflowWithBicep - } -} - Describe 'Test flags that skip logic' -Tag 'Skip' { BeforeAll { From 5c709e0cfb4d0c29f7e67dd51854228c29635b21 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Thu, 7 Sep 2023 11:16:58 +0200 Subject: [PATCH 3/3] Update to latest --- .github/workflows/platform.convertToArmTemplate.tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform.convertToArmTemplate.tests.yml b/.github/workflows/platform.convertToArmTemplate.tests.yml index 35aa597ae8..b68fcad688 100644 --- a/.github/workflows/platform.convertToArmTemplate.tests.yml +++ b/.github/workflows/platform.convertToArmTemplate.tests.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - tags: ['Default', 'ConvertChildren', 'Skip'] + tags: ['Default', 'Skip'] steps: - name: 'Checkout' uses: actions/checkout@v3