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

查看:28
本文介绍了尝试在 jenkins 上运行 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.0Common7IDEMSTest.exe" /testcontainer:Example.TestsinDebugExample.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.0Common7IDEMSTest.exe" /testcontainer:Example.TestsinDebugExample.Tests.dll /resultsfile:TestResults.trx /nologo
EXIT /B 0

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

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