@@ -84,6 +84,12 @@ Param(
84
84
$CIPlanPath = " $RepoArtifacts /PipelineResult/CIPlan.json"
85
85
$PipelineResultPath = " $RepoArtifacts /PipelineResult/PipelineResult.json"
86
86
87
+ $testResults = @ {
88
+ Succeeded = 1
89
+ Warning = 10
90
+ Failed = 100
91
+ }
92
+
87
93
Function Get-PlatformInfo
88
94
{
89
95
If ($IsWindows )
@@ -134,8 +140,10 @@ Function Set-ModuleTestStatusInPipelineResult
134
140
{
135
141
If ($ModuleInfo.Module -Eq $ModuleName )
136
142
{
137
- $ModuleInfo.Status = $Status
138
- $ModuleInfo.Content = $Content
143
+ if ([string ]::IsNullOrWhiteSpace($ModuleInfo.Status ) -or $testResults [$ModuleInfo.Status ] -lt $testResults [$Status ]) {
144
+ $ModuleInfo.Status = $Status
145
+ $ModuleInfo.Content = $Content
146
+ }
139
147
}
140
148
}
141
149
ConvertTo-Json - Depth 10 - InputObject $PipelineResult | Out-File - FilePath $PipelineResultPath
@@ -315,7 +323,7 @@ If ($TestAutorest)
315
323
If ($Test -And (($CIPlan.test.Length -Ne 0 ) -Or ($PSBoundParameters.ContainsKey (" TargetModule" ))))
316
324
{
317
325
dotnet test $RepoArtifacts / Azure.PowerShell.sln -- filter " AcceptanceType=CheckIn&RunType!=DesktopOnly" -- configuration $Configuration -- framework $TestFramework -- logger trx -- results- directory $TestOutputDirectory
318
-
326
+
319
327
$TestResultFiles = Get-ChildItem " $RepoArtifacts /TestResults/" - Filter * .trx
320
328
$FailedTestCases = @ {}
321
329
Foreach ($TestResultFile in $TestResultFiles )
@@ -356,7 +364,7 @@ If ($Test -And (($CIPlan.test.Length -Ne 0) -Or ($PSBoundParameters.ContainsKey(
356
364
Set-ModuleTestStatusInPipelineResult - ModuleName $ModuleInfo.Module - Status $Status
357
365
}
358
366
}
359
-
367
+
360
368
If ($FailedTestCases.Length -ne 0 )
361
369
{
362
370
Return -1
@@ -493,4 +501,4 @@ If ($StaticAnalysisCmdletDiff)
493
501
dotnet $RepoArtifacts / StaticAnalysis/ StaticAnalysis.Netcore.dll - p $RepoArtifacts / $Configuration - r $StaticAnalysisOutputDirectory -- analyzers cmdlet- diff - u - m $CmdletDiffModuleList
494
502
}
495
503
Return
496
- }
504
+ }
0 commit comments