@@ -61,17 +61,19 @@ $cvgReportCsv = Join-Path -Path $cvgResultsDir -ChildPath "Report.csv"
6161({} | Select-Object " Module" , " TotalCommands" , " TestedCommands" , " CommandCoverage" , " TotalParameterSets" , " TestedParameterSets" , " ParameterSetCoverage" , " TotalParameters" , " TestedParameters" , " ParameterCoverage" | ConvertTo-Csv - NoTypeInformation)[0 ] | Out-File - LiteralPath $cvgReportCsv - Encoding utf8 - Force
6262
6363$allModules = Get-ChildItem - Path $debugDir - Filter " Az.*" - Directory - Name
64+ $testedModules = $allModules
6465
6566if ($CalcBaseline.IsPresent ) {
66- $testedModules = $allModules
6767 $cvgBaselineCsv = Join-Path - Path $cvgResultsDir - ChildPath " Baseline.csv"
6868 ({} | Select-Object " Module" , " CommandCoverage" | ConvertTo-Csv - NoTypeInformation)[0 ] | Out-File - LiteralPath $cvgBaselineCsv - Encoding utf8 - Force
6969}
7070else {
7171 $ciPlanFilePath = Join-Path - Path $artifactsDir - ChildPath " PipelineResult" | Join-Path - ChildPath " CIPlan.json"
72- $ciPlan = Get-Content - Path $ciPlanFilePath - Raw | ConvertFrom-Json
73- if ($ciPlan.test.Length -gt 0 ) {
74- $testedModules = $allModules | Where-Object { $_.Substring (3 ) -in $ciPlan.test }
72+ if (Test-Path - Path $ciPlanFilePath - PathType Leaf) {
73+ $ciPlan = Get-Content - Path $ciPlanFilePath - Raw | ConvertFrom-Json
74+ if ($ciPlan.test.Length -gt 0 ) {
75+ $testedModules = $allModules | Where-Object { $_.Substring (3 ) -in $ciPlan.test }
76+ }
7577 }
7678}
7779
@@ -195,8 +197,8 @@ foreach ($moduleName in $testedModules) {
195197
196198 if ($CalcBaseline.IsPresent ) {
197199 $cvgBaseline = [PSCustomObject ]@ {
198- Module = $simpleModuleName
199- CommandCoverage = $cvgCommand
200+ Module = $simpleModuleName
201+ CommandCoverage = $cvgCommand
200202 }
201203 $cvgBaseline | Export-Csv - Path $cvgBaselineCsv - Encoding utf8 - NoTypeInformation - Append - Force
202204 }
0 commit comments