@@ -219,7 +219,8 @@ function Invoke-CITest
219
219
[ValidateSet (' UnelevatedPesterTests' , ' ElevatedPesterTests' )]
220
220
[string ] $Purpose ,
221
221
[ValidateSet (' CI' , ' Others' )]
222
- [string ] $TagSet
222
+ [string ] $TagSet ,
223
+ [string ] $TitlePrefix
223
224
)
224
225
225
226
# Set locale correctly for Linux CIs
@@ -244,7 +245,7 @@ function Invoke-CITest
244
245
245
246
if ($IsLinux -or $IsMacOS )
246
247
{
247
- return Invoke-LinuxTestsCore - Purpose $Purpose - ExcludeTag $ExcludeTag - TagSet $TagSet
248
+ return Invoke-LinuxTestsCore - Purpose $Purpose - ExcludeTag $ExcludeTag - TagSet $TagSet - TitlePrefix $TitlePrefix
248
249
}
249
250
250
251
# CoreCLR
@@ -271,7 +272,12 @@ function Invoke-CITest
271
272
ExcludeTag = $ExcludeTag + ' RequireAdminOnWindows'
272
273
}
273
274
274
- Start-PSPester @arguments - Title " Pester Unelevated - $TagSet "
275
+ $title = " Pester Unelevated - $TagSet "
276
+ if ($TitlePrefix ) {
277
+ $title = " $TitlePrefix - $title "
278
+ }
279
+ Start-PSPester @arguments - Title $title
280
+
275
281
# Fail the build, if tests failed
276
282
Test-PSPesterResults - TestResultsFile $testResultsNonAdminFile
277
283
@@ -293,7 +299,11 @@ function Invoke-CITest
293
299
$arguments [' Path' ] = $testFiles
294
300
}
295
301
296
- Start-PSPester @arguments - Title " Pester Experimental Unelevated - $featureName "
302
+ $title = " Pester Experimental Unelevated - $featureName "
303
+ if ($TitlePrefix ) {
304
+ $title = " $TitlePrefix - $title "
305
+ }
306
+ Start-PSPester @arguments - Title $title
297
307
298
308
# Fail the build, if tests failed
299
309
Test-PSPesterResults - TestResultsFile $expFeatureTestResultFile
@@ -309,7 +319,11 @@ function Invoke-CITest
309
319
ExcludeTag = $ExcludeTag
310
320
}
311
321
312
- Start-PSPester @arguments - Title " Pester Elevated - $TagSet "
322
+ $title = " Pester Elevated - $TagSet "
323
+ if ($TitlePrefix ) {
324
+ $title = " $TitlePrefix - $title "
325
+ }
326
+ Start-PSPester @arguments - Title $title
313
327
314
328
# Fail the build, if tests failed
315
329
Test-PSPesterResults - TestResultsFile $testResultsAdminFile
@@ -334,7 +348,12 @@ function Invoke-CITest
334
348
# If a non-empty string or array is specified for the feature name, we only run those test files.
335
349
$arguments [' Path' ] = $testFiles
336
350
}
337
- Start-PSPester @arguments - Title " Pester Experimental Elevated - $featureName "
351
+
352
+ $title = " Pester Experimental >levated - $featureName "
353
+ if ($TitlePrefix ) {
354
+ $title = " $TitlePrefix - $title "
355
+ }
356
+ Start-PSPester @arguments - Title $title
338
357
339
358
# Fail the build, if tests failed
340
359
Test-PSPesterResults - TestResultsFile $expFeatureTestResultFile
@@ -612,7 +631,8 @@ function Invoke-LinuxTestsCore
612
631
[ValidateSet (' UnelevatedPesterTests' , ' ElevatedPesterTests' , ' All' )]
613
632
[string ] $Purpose = ' All' ,
614
633
[string []] $ExcludeTag = @ (' Slow' , ' Feature' , ' Scenario' ),
615
- [string ] $TagSet = ' CI'
634
+ [string ] $TagSet = ' CI' ,
635
+ [string ] $TitlePrefix
616
636
)
617
637
618
638
$output = Split-Path - Parent (Get-PSOutput - Options (Get-PSOptions ))
@@ -639,7 +659,11 @@ function Invoke-LinuxTestsCore
639
659
# Running tests which do not require sudo.
640
660
if ($Purpose -eq ' UnelevatedPesterTests' -or $Purpose -eq ' All' )
641
661
{
642
- $pesterPassThruNoSudoObject = Start-PSPester @noSudoPesterParam - Title " Pester No Sudo - $TagSet "
662
+ $title = " Pester No Sudo - $TagSet "
663
+ if ($TitlePrefix ) {
664
+ $title = " $TitlePrefix - $title "
665
+ }
666
+ $pesterPassThruNoSudoObject = Start-PSPester @noSudoPesterParam - Title $title
643
667
644
668
# Running tests that do not require sudo, with specified experimental features enabled
645
669
$noSudoResultsWithExpFeatures = @ ()
@@ -660,7 +684,12 @@ function Invoke-LinuxTestsCore
660
684
# If a non-empty string or array is specified for the feature name, we only run those test files.
661
685
$noSudoPesterParam [' Path' ] = $testFiles
662
686
}
663
- $passThruResult = Start-PSPester @noSudoPesterParam - Title " Pester Experimental No Sudo - $featureName - $TagSet "
687
+ $title = " Pester Experimental No Sudo - $featureName - $TagSet "
688
+ if ($TitlePrefix ) {
689
+ $title = " $TitlePrefix - $title "
690
+ }
691
+ $passThruResult = Start-PSPester @noSudoPesterParam - Title $title
692
+
664
693
$noSudoResultsWithExpFeatures += $passThruResult
665
694
}
666
695
}
@@ -674,7 +703,12 @@ function Invoke-LinuxTestsCore
674
703
$sudoPesterParam [' ExcludeTag' ] = $ExcludeTag
675
704
$sudoPesterParam [' Sudo' ] = $true
676
705
$sudoPesterParam [' OutputFile' ] = $testResultsSudo
677
- $pesterPassThruSudoObject = Start-PSPester @sudoPesterParam - Title " Pester Sudo - $TagSet "
706
+
707
+ $title = " Pester Sudo - $TagSet "
708
+ if ($TitlePrefix ) {
709
+ $title = " $TitlePrefix - $title "
710
+ }
711
+ $pesterPassThruSudoObject = Start-PSPester @sudoPesterParam - Title $title
678
712
679
713
# Running tests that require sudo, with specified experimental features enabled
680
714
$sudoResultsWithExpFeatures = @ ()
@@ -696,7 +730,13 @@ function Invoke-LinuxTestsCore
696
730
# If a non-empty string or array is specified for the feature name, we only run those test files.
697
731
$sudoPesterParam [' Path' ] = $testFiles
698
732
}
699
- $passThruResult = Start-PSPester @sudoPesterParam - Title " Pester Experimental Sudo - $featureName - $TagSet "
733
+
734
+ $title = " Pester Experimental Sudo - $featureName - $TagSet "
735
+ if ($TitlePrefix ) {
736
+ $title = " $TitlePrefix - $title "
737
+ }
738
+ $passThruResult = Start-PSPester @sudoPesterParam - Title $title
739
+
700
740
$sudoResultsWithExpFeatures += $passThruResult
701
741
}
702
742
}
0 commit comments