diff --git a/.pipelines/ci/templates/run-ui-tests-ci.yml b/.pipelines/ci/templates/run-ui-tests-ci.yml index 8c93f01ce7..f9625eaa7a 100644 --- a/.pipelines/ci/templates/run-ui-tests-ci.yml +++ b/.pipelines/ci/templates/run-ui-tests-ci.yml @@ -36,32 +36,14 @@ jobs: - task: VisualStudioTestPlatformInstaller@1 displayName: Ensure VSTest Platform - - task: VSTest@2 - displayName: 'MS Tests' - condition: ne(variables['BuildPlatform'], 'arm64') # No arm64 agents to run the tests. + - task: PowerShell@2 + displayName: 'Run UI Tests' inputs: - platform: '$(BuildPlatform)' - configuration: '$(BuildConfiguration)' - testSelector: 'testAssemblies' - searchFolder: '$(Build.ArtifactStagingDirectory)' - vstestLocationMethod: 'location' - vstestLocation: 'D:\a\_work\_temp\VsTest' - testAssemblyVer2: | - **\UnitTests-FancyZonesEditor.dll - !**\obj\** - !**\ref\** - - - task: VSTest@2 - displayName: 'UI Tests' - condition: ne(variables['BuildPlatform'], 'arm64') # No arm64 agents to run the tests. - inputs: - platform: '$(BuildPlatform)' - configuration: '$(BuildConfiguration)' - testSelector: 'testAssemblies' - searchFolder: '$(Build.ArtifactStagingDirectory)' - vstestLocationMethod: 'location' - vstestLocation: 'D:\a\_work\_temp\VsTest' - uiTests: true - testAssemblyVer2: | - **\UITests-FancyZones.dll - **\UITests-FancyZonesEditor.dll + targetType: filePath + filePath: .pipelines\scripts\runUiTests.ps1 + arguments: >- + -SearchFolder '$(Build.ArtifactStagingDirectory)\x64\**\UITests-FancyZonesEditor.dll' + -VsConsolePath 'D:\a\_work\_temp\VsTest' + -MatchPattern '**\UITests-*.dll' + -LogPath '$(Build.ArtifactStagingDirectory)\Logs' + -ResultPath "$(Build.ArtifactStagingDirectory)\TestResults" diff --git a/.pipelines/scripts/runUiTests.ps1 b/.pipelines/scripts/runUiTests.ps1 new file mode 100644 index 0000000000..044c063dea --- /dev/null +++ b/.pipelines/scripts/runUiTests.ps1 @@ -0,0 +1,18 @@ +[CmdLetBinding()] +Param( + [Parameter(Mandatory=$true, Position=0)] + [string]$SearchFolder, + [Parameter(Mandatory=$true, Position=1)] + [string]$VsConsolePath, + [Parameter(Mandatory=$true, Position=2)] + [string]$MatchPattern, + [Parameter(Mandatory=$true, Position=3)] + [string]$LogPath, + [Parameter(Mandatory=$true, Position=4)] + [string]$ResultPath +) + +Write-Output "Starting UI tests" + +$Cmd = "$VsConsolePath\vstest.console.exe $SearchFolder /Logger:trx;LogFileName=$LogPath /ResultsDirectory:$ResultPath" +Invoke-Expression -Command $Cmd \ No newline at end of file