@@ -61,17 +61,19 @@ $cvgReportCsv = Join-Path -Path $cvgResultsDir -ChildPath "Report.csv"
61
61
({} | Select-Object " Module" , " TotalCommands" , " TestedCommands" , " CommandCoverage" , " TotalParameterSets" , " TestedParameterSets" , " ParameterSetCoverage" , " TotalParameters" , " TestedParameters" , " ParameterCoverage" | ConvertTo-Csv - NoTypeInformation)[0 ] | Out-File - LiteralPath $cvgReportCsv - Encoding utf8 - Force
62
62
63
63
$allModules = Get-ChildItem - Path $debugDir - Filter " Az.*" - Directory - Name
64
+ $testedModules = $allModules
64
65
65
66
if ($CalcBaseline.IsPresent ) {
66
- $testedModules = $allModules
67
67
$cvgBaselineCsv = Join-Path - Path $cvgResultsDir - ChildPath " Baseline.csv"
68
68
({} | Select-Object " Module" , " CommandCoverage" | ConvertTo-Csv - NoTypeInformation)[0 ] | Out-File - LiteralPath $cvgBaselineCsv - Encoding utf8 - Force
69
69
}
70
70
else {
71
71
$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
+ }
75
77
}
76
78
}
77
79
@@ -195,8 +197,8 @@ foreach ($moduleName in $testedModules) {
195
197
196
198
if ($CalcBaseline.IsPresent ) {
197
199
$cvgBaseline = [PSCustomObject ]@ {
198
- Module = $simpleModuleName
199
- CommandCoverage = $cvgCommand
200
+ Module = $simpleModuleName
201
+ CommandCoverage = $cvgCommand
200
202
}
201
203
$cvgBaseline | Export-Csv - Path $cvgBaselineCsv - Encoding utf8 - NoTypeInformation - Append - Force
202
204
}
0 commit comments