英文:
Jenkins VSTest Runner not working as expected
问题
以下是翻译好的部分:
在Jenkins中无法使VSTest插件正常工作。
首先,这个命令行版本是正常工作的,所以我知道路径等都是正确的 -
"C:\Program Files\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" C:\Pelican\Debug\net6.0\Test.dll /TestCaseFilter:"SidebarMobile" /Logger:trx
所以回到Jenkins仪表板>Jenkins管理>工具,我们有
所以当我运行作业时,即使路径正确,我在控制台输出中看到以下内容
VSTest.console.exe的路径:C:\Program Files\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\
没有匹配模式C:\Pelican\Debug\net6.0\Test.dll的文件
执行VSTest: cmd.exe /C C:\Users\jenkins\AppData\Local\Temp\vstest7467014175321632084.bat && exit %ERRORLEVEL%
[Pi Mobile Tests] $ cmd.exe /C C:\Users\jenkins\AppData\Local\Temp\vstest7467014175321632084.bat && exit %ERRORLEVEL%
C:\Users\jenkins\AppData\Local\Jenkins\.jenkins\workspace\Pi Mobile Tests>C:\Program Files\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\ /Tests:Sidebar /TestCaseFilter:"SidebarMobile" /UseVsixExtensions:false /Logger:trx
'C:\Program'不被识别为内部或外部命令,可执行程序或批处理文件。
因此回到Jenkins仪表板>Jenkins管理>工具,我们现在有
C:\PROGRA~1\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\
现在我看到
VSTest.console.exe的路径:C:\PROGRA~1\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\
没有匹配模式C:\Pelican\Debug\net6.0\Test.dll的文件
执行VSTest: cmd.exe /C C:\Users\jenkins\AppData\Local\Temp\vstest17161354381707712024.bat && exit %ERRORLEVEL%
[Pi Mobile Tests] $ cmd.exe /C C:\Users\jenkins\AppData\Local\Temp\vstest17161354381707712024.bat && exit %ERRORLEVEL%
C:\Users\jenkins\AppData\Local\Jenkins\.jenkins\workspace\Pi Mobile Tests>C:\PROGRA~1\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\ /Tests:Sidebar /TestCaseFilter:"SidebarMobile" /UseVsixExtensions:false /Logger:trx
'C:\PROGRA~1\Microsoft'不被识别为内部或外部命令,可执行程序或批处理文件。
是否有任何解决方案?
英文:
Having problems get VSTest plugin to work in Jenkins.
So first this command line version works spot on so I know the paths etc are correct -
"C:\Program Files\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" C:\Pelican\Debug\net6.0\Test.dll /TestCaseFilter:"SidebarMobile" /Logger:trx
So back to Jenkins Dashboard>Manage Jenkins>Tools we have
So when I run the job I see this in console output even though the paths are correct
Path To VSTest.console.exe: C:\Program Files\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\
no files matching the pattern C:\Pelican\Debug\net6.0\Test.dll
Executing VSTest: cmd.exe /C C:\Users\jenkins\AppData\Local\Temp\vstest7467014175321632084.bat && exit %ERRORLEVEL%
[Pi Mobile Tests] $ cmd.exe /C C:\Users\jenkins\AppData\Local\Temp\vstest7467014175321632084.bat && exit %ERRORLEVEL%
C:\Users\jenkins\AppData\Local\Jenkins\.jenkins\workspace\Pi Mobile Tests>C:\Program Files\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\ /Tests:Sidebar /TestCaseFilter:"SidebarMobile" /UseVsixExtensions:false /Logger:trx
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
So back to Jenkins Dashboard>Manage Jenkins>Tools we now have
C:\PROGRA~1\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\
I now see
Path To VSTest.console.exe: C:\PROGRA~1\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\
no files matching the pattern C:\Pelican\Debug\net6.0\Test.dll
Executing VSTest: cmd.exe /C C:\Users\jenkins\AppData\Local\Temp\vstest17161354381707712024.bat && exit %ERRORLEVEL%
[Pi Mobile Tests] $ cmd.exe /C C:\Users\jenkins\AppData\Local\Temp\vstest17161354381707712024.bat && exit %ERRORLEVEL%
C:\Users\jenkins\AppData\Local\Jenkins\.jenkins\workspace\Pi Mobile Tests>C:\PROGRA~1\Microsoft Visual Studio22\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\ /Tests:Sidebar /TestCaseFilter:"SidebarMobile" /UseVsixExtensions:false /Logger:trx
'C:\PROGRA~1\Microsoft' is not recognized as an internal or external command,
operable program or batch file.
Any solutions please
答案1
得分: 0
我现在正在使用“执行Windows批处理命令”,从那里运行正常。
英文:
I am now using "Execute Windows batch command", works fine from there
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论