-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
As a workaround to the newer version of VsTest not being used by this action, I resorted to attempting to use the vstestLocation input argument.
VSWHERE correctly returns a path of:
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe.
Because the long path names include spaces, passing this value through vstestLocation input argument produces error:
Error: Unable to locate executable file: C:\Program. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
Release Version: 1.0.0
How to reproduce:
- In your workflow add a powershell step containing:
- id: setup
run: |
$vswhere=vswhere -latest -products * -requires Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.Web -requiresAny -property installationPath
$vswhere=join-path $vswhere 'Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe'
if (test-path $vswhere) {
write-output "vstest-path=$vswhere" >> $env:GITHUB_OUTPUT
} else {
write-output "::warning::Unable to locate VSTest.console.exe"
}
shell: pwsh- use vstest-action passing vstestLocation argument
- name: Run vstests
uses: microsoft/vstest-action@v1.0.0
with:
searchFolder: '${{github.workspace}}/out'
vstestLocationMethod: location
vstestLocation: '${{ steps.setup.outputs.vstest-path }}'
testAssembly: |
**/*test*.dll
!./**/*TestAdapter.dll
!./**/obj/**- run workflow and observe error
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels