尝试在詹金斯上运行mstest时出错 [英] Error trying to run mstest on jenkins

查看:231
本文介绍了尝试在詹金斯上运行mstest时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在jenkins上配置MSTest构建插件,但出现以下错误:

I´m trying to configure MSTest build plugin on jenkins, but I´m getting the following error:

Path To MSTest.exe: mstest.exe
Result file was not found so no action has been taken. file:/C:/Program%20Files%20(x86)/Jenkins/jobs/SoftwrenchvNext/workspace/TestResult.trx
FATAL: null
java.lang.NullPointerException
    at org.jenkinsci.plugins.MsTestBuilder.perform(MsTestBuilder.java:144)

该配置仅将TestResult.trx指定为ResultFileName.该文件没有版本,我希望可以在每个版本上创建它.

The configuration simply specifies TestResult.trx as ResultFileName. This file is not versioned, and I expect it to be created on each build.

为此需要做什么?

推荐答案

我也有这个完全相同的错误消息!

I too had this exact same error message!

我的建议是替换用MSTest运行单元测试"步骤.使用执行Windows批处理命令"步骤.这对我有用.

My recommendation is to replace the "Run unit tests with MSTest" step. with an "Execute Windows batch command" step. This worked for me.

命令

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

使用此技术,您仍然可以使用发布MSTest测试结果报告"步骤指定...

Using this technique you may still use the "Publish MSTest test result report" step specifying...

测试报告TRX文件

TestResults.trx

祝你好运!

此外,您可以通过"EXIT"调用模拟"失败测试继续"功能,如下所示.

Also, you can "simulate" the "Continue on failed tests" functionality with an "EXIT" call, seen below.

del TestResults.trx
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testcontainer:Example.Tests\bin\Debug\Example.Tests.dll /resultsfile:TestResults.trx /nologo
EXIT /B 0

这篇关于尝试在詹金斯上运行mstest时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆