|
19 | 19 | # runs the tests for each project on a background job in parallel, |
20 | 20 | # then uploads the results to Azure DevOps pipelines |
21 | 21 |
|
22 | | -# NOTE: Depends on environment variables $(IsNightly) and $(IsWeekly) |
| 22 | +# NOTE: Depends on environment variables $(IsNightly), $(IsWeekly), and $(DisplayFullName) |
23 | 23 |
|
24 | 24 | parameters: |
25 | 25 | osName: 'Windows' # The name of the operating system for display purposes. |
@@ -172,6 +172,7 @@ steps: |
172 | 172 | $tempDirectory = "$(Agent.TempDirectory)" |
173 | 173 | $isNightly = if ($env:ISNIGHTLY -eq 'true') { 'true' } else { 'false' } |
174 | 174 | $isWeekly = if ($env:ISWEEKLY -eq 'true') { 'true' } else { 'false' } |
| 175 | + $displayFullName = if ($env:DISPLAYFULLNAME -eq 'false') { 'false' } else { 'true' } |
175 | 176 |
|
176 | 177 | function IsSupportedFramework([string]$framework) { |
177 | 178 | if ($IsWindows -eq $null) { |
@@ -226,6 +227,10 @@ steps: |
226 | 227 |
|
227 | 228 | $testExpression = "$testExpression -- RunConfiguration.TargetPlatform=$testPlatform" |
228 | 229 |
|
| 230 | + if ($displayFullName -eq 'true') { |
| 231 | + $testExpression = "$testExpression NUnit.DisplayName=FullName" |
| 232 | + } |
| 233 | +
|
229 | 234 | Write-Host "Testing '$($testBinary.FullName)' on framework '$framework' and outputting test results to '$testResultDirectory/$testResultsFileName'..." |
230 | 235 | Write-Host $testExpression -ForegroundColor Magenta |
231 | 236 | if ($maximumParalellJobs -le 1) { |
@@ -305,6 +310,16 @@ steps: |
305 | 310 | Write-Host "##vso[task.logissue type=error;]Test run failed due to too many failed tests. Maximum failures allowed: $maximumAllowedFailures, total failures: $($env:TOTALFAILURES)." |
306 | 311 | $failed = $true |
307 | 312 | } |
| 313 | + if ([int]$maximumAllowedFailures -eq 0 -and $env:STDERRFAILURE -eq 'true') { |
| 314 | + $runsExpanded = "$($env:STDERRFAILURERUNS)" -replace ',',"`r`n" |
| 315 | + Write-Host "##vso[task.logissue type=error;]StdErr file(s) indicate test failures. Review the testresults artifacts for details. (click here to view the projects that failed)`r`n$runsExpanded" |
| 316 | + $failed = $true |
| 317 | + } |
| 318 | + if ([int]$maximumAllowedFailures -eq 0 -and $env:STDOUTFAILURE -eq 'true') { |
| 319 | + $runsExpanded = "$($env:STDOUTFAILURERUNS)" -replace ',',"`r`n" |
| 320 | + Write-Host "##vso[task.logissue type=error;]StdOut file(s) indicate test failures. Review the testresults artifacts for details. (click here to view the projects that failed)`r`n$runsExpanded" |
| 321 | + $failed = $true |
| 322 | + } |
308 | 323 | if ($failed) { |
309 | 324 | Write-Host "##vso[task.complete result=Failed;]" |
310 | 325 | } |
0 commit comments