From 754015ae56a6d8eab45d3d8822b754c8750f7976 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 21 Jan 2019 21:24:41 +0800 Subject: [PATCH] (maint) Reinstate test filtering Previously in commit b13bef14d7771d6ee86c399868a the ability to filter which tests were run in order to speed up development. However in commit 449cc21d30ccfc0a7 this was removed. This commit resinstates the test filtering and uses the new command line arguemnt --filter instead of the old xunit command. --- PowerShellEditorServices.build.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PowerShellEditorServices.build.ps1 b/PowerShellEditorServices.build.ps1 index 8f543c3a4..4f6fe8804 100644 --- a/PowerShellEditorServices.build.ps1 +++ b/PowerShellEditorServices.build.ps1 @@ -348,9 +348,9 @@ function UploadTestLogs { } } -function XunitTraitFilter { +function DotNetTestFilter { # Reference https://docs.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests - if ($TestFilter) { "-trait $TestFilter" } else { "" } + if ($TestFilter) { @("--filter",$TestFilter) } else { "" } } task Test TestServer,TestProtocol @@ -359,11 +359,11 @@ task TestServer { Set-Location .\test\PowerShellEditorServices.Test\ if (-not $script:IsUnix) { - exec { & $script:dotnetExe test -f $script:TestRuntime.Desktop } + exec { & $script:dotnetExe test -f $script:TestRuntime.Desktop (DotNetTestFilter) } } Invoke-WithCreateDefaultHook -NewModulePath $script:PSCoreModulePath { - exec { & $script:dotnetExe test -f $script:TestRuntime.Core } + exec { & $script:dotnetExe test -f $script:TestRuntime.Core (DotNetTestFilter) } } } @@ -371,11 +371,11 @@ task TestProtocol { Set-Location .\test\PowerShellEditorServices.Test.Protocol\ if (-not $script:IsUnix) { - exec { & $script:dotnetExe test -f $script:TestRuntime.Desktop } + exec { & $script:dotnetExe test -f $script:TestRuntime.Desktop (DotNetTestFilter) } } Invoke-WithCreateDefaultHook { - exec { & $script:dotnetExe test -f $script:TestRuntime.Core } + exec { & $script:dotnetExe test -f $script:TestRuntime.Core (DotNetTestFilter) } } } @@ -384,11 +384,11 @@ task TestHost { if (-not $script:IsUnix) { exec { & $script:dotnetExe build -f $script:TestRuntime.Desktop } - exec { & $script:dotnetExe test -f $script:TestRuntime.Desktop } + exec { & $script:dotnetExe test -f $script:TestRuntime.Desktop (DotNetTestFilter) } } exec { & $script:dotnetExe build -c $Configuration -f $script:TestRuntime.Core } - exec { & $script:dotnetExe test -f $script:TestRuntime.Core } + exec { & $script:dotnetExe test -f $script:TestRuntime.Core (DotNetTestFilter) } } task CITest ?Test, {