|
11 | 11 |
|
12 | 12 | [string]$ModulesJsonPath = "$PSScriptRoot/modules.json", |
13 | 13 |
|
14 | | - [string]$DefaultModuleRepository = "PSGallery" |
| 14 | + [string]$DefaultModuleRepository = "PSGallery", |
| 15 | + |
| 16 | + [string]$TestFilter = '' |
15 | 17 | ) |
16 | 18 |
|
17 | 19 | #Requires -Modules @{ModuleName="InvokeBuild";ModuleVersion="3.2.1"} |
@@ -223,24 +225,29 @@ function UploadTestLogs { |
223 | 225 | } |
224 | 226 | } |
225 | 227 |
|
| 228 | +function XunitTraitFilter { |
| 229 | + # Reference https://docs.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests |
| 230 | + if ($TestFilter) { "-trait $TestFilter" } else { "" } |
| 231 | +} |
| 232 | + |
226 | 233 | task Test TestServer,TestProtocol |
227 | 234 |
|
228 | 235 | task TestServer -If { !$script:IsUnix } { |
229 | 236 | Set-Location .\test\PowerShellEditorServices.Test\ |
230 | 237 | exec { & $script:dotnetExe build -c $Configuration -f net452 } |
231 | | - exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild } |
| 238 | + exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild (XunitTraitFilter) } |
232 | 239 | } |
233 | 240 |
|
234 | 241 | task TestProtocol -If { !$script:IsUnix } { |
235 | 242 | Set-Location .\test\PowerShellEditorServices.Test.Protocol\ |
236 | 243 | exec { & $script:dotnetExe build -c $Configuration -f net452 } |
237 | | - exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild } |
| 244 | + exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild (XunitTraitFilter) } |
238 | 245 | } |
239 | 246 |
|
240 | 247 | task TestHost -If { !$script:IsUnix } { |
241 | 248 | Set-Location .\test\PowerShellEditorServices.Test.Host\ |
242 | 249 | exec { & $script:dotnetExe build -c $Configuration -f net452 } |
243 | | - exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild } |
| 250 | + exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild (XunitTraitFilter) } |
244 | 251 | } |
245 | 252 |
|
246 | 253 | task CITest ?Test, { |
|
0 commit comments