@@ -33,7 +33,8 @@ $psCommonParameters = @("-Break", "-Confirm", "-Debug", "-DefaultProfile", "-Err
33
33
" -OutBuffer" , " -OutVariable" , " -PassThru" , " -PipelineVariable" , " -Proxy" , " -ProxyCredential" , " -ProxyUseDefaultCredentials" , " -Verbose" , " -WarningAction" , " -WarningVariable" , " -WhatIf" )
34
34
35
35
$repoDir = $PSScriptRoot | Split-Path | Split-Path | Split-Path
36
- $debugDir = Join-Path - Path $repoDir - ChildPath " artifacts" | Join-Path - ChildPath " Debug"
36
+ $artifactsDir = Join-Path - Path $repoDir - ChildPath " artifacts"
37
+ $debugDir = Join-Path - Path $artifactsDir - ChildPath " Debug"
37
38
38
39
$accountsModuleName = " Az.Accounts"
39
40
$accountsModulePsd1 = Join-Path - Path $debugDir - ChildPath $accountsModuleName | Join-Path - ChildPath " $accountsModuleName .psd1"
@@ -59,16 +60,25 @@ else {
59
60
$cvgReportCsv = Join-Path - Path $cvgResultsDir - ChildPath " Report.csv"
60
61
({} | Select-Object " Module" , " TotalCommands" , " TestedCommands" , " CommandCoverage" , " TotalParameterSets" , " TestedParameterSets" , " ParameterSetCoverage" , " TotalParameters" , " TestedParameters" , " ParameterCoverage" | ConvertTo-Csv - NoTypeInformation)[0 ] | Out-File - LiteralPath $cvgReportCsv - Encoding utf8 - Force
61
62
63
+ $allModules = Get-ChildItem - Path $debugDir - Filter " Az.*" - Directory - Name
64
+
62
65
if ($CalcBaseline.IsPresent ) {
66
+ $testedModules = $allModules
63
67
$cvgBaselineCsv = Join-Path - Path $cvgResultsDir - ChildPath " Baseline.csv"
64
68
({} | Select-Object " Module" , " CommandCoverage" | ConvertTo-Csv - NoTypeInformation)[0 ] | Out-File - LiteralPath $cvgBaselineCsv - Encoding utf8 - Force
65
69
}
70
+ else {
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 }
75
+ }
76
+ }
66
77
67
78
$overallCommandsCount = 0
68
79
$overallTestedCommandsCount = 0
69
80
70
- $allModules = Get-ChildItem - Path $debugDir - Filter " Az.*" - Directory - Name
71
- foreach ($moduleName in $allModules ) {
81
+ foreach ($moduleName in $testedModules ) {
72
82
$simpleModuleName = $moduleName.Substring (3 )
73
83
$hasRawData = $true
74
84
0 commit comments