Jenkins VSTest Runner未按预期工作。

huangapple go评论62阅读模式
英文:

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管理>工具,我们有
Jenkins VSTest Runner未按预期工作。

以及在作业本身
Jenkins VSTest Runner未按预期工作。

所以当我运行作业时,即使路径正确,我在控制台输出中看到以下内容

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
Jenkins VSTest Runner未按预期工作。

And in the job itself
Jenkins VSTest Runner未按预期工作。

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

huangapple
  • 本文由 发表于 2023年4月6日 20:57:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/75949803.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定