小编典典

Jenkins MSTestRunner插件无法启动mstest.exe

jenkins

我已将Jenkins MSTestRunner插件配置为使用MSTest可执行文件的以下路径:“ C:\
Program Files(x86)\ Microsoft Visual Studio 11.0 \ Common7 \ IDE \
mstest.exe”。但是,尽管此路径是正确的,但是构建失败如下:

cmd.exe /C "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\mstest.exe" "/resultsfile:/resultsfile testresults" /testcontainer:Project.Tests/bin/Debug/Project.Tests.dll && exit %%ERRORLEVEL%%
'C:\Program' is not recognized as an internal or external command, operable program or batch file.

这里的问题是什么,我认为这是配置MSTestRunner插件的正常方法,因为mstest.exe安装在Visual Studio下,而Visual
Studio通常又安装在“ C:\ Program Files(X86)”下?我该如何解决?


阅读 299

收藏
2020-07-25

共1个答案

小编典典

已从插件作者处收到确认,MSTestRunner
0.2.0不能处理MSTest路径中的空格。我通过在Jenkins中创建一个“执行Windows批处理命令”构建步骤来解决此问题,该步骤直接调用mstest.exe,在该步骤中,我用双引号将mstest.exe路径包围了:

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testcontainer:Project.Tests\bin\Debug\Project.Tests.dll /resultsfile:testresults.trx
2020-07-25