本文介绍了Jenkins MSTestRunner插件无法启动mstest.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've configured the Jenkins MSTestRunner plugin to use the following path to the MSTest executable: 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\mstest.exe'. However, although this path is correct, the build fails as follows:

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)"下?我该如何解决?

What's the issue here, I thought this would be the normal way of configuring the MSTestRunner plugin as mstest.exe is installed beneath Visual Studio, which is again typically installed under 'C:\Program Files (X86)'? How do I work around this?

推荐答案

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

Have received confirmation from the plugin author that MSTestRunner 0.2.0 doesn't handle spaces in MSTest paths. I worked around the issue by instead creating an "Execute Windows batch command" build step in Jenkins that invokes mstest.exe directly, where I've surrounded the mstest.exe path with double quotes:

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

这篇关于Jenkins MSTestRunner插件无法启动mstest.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 01:52