如何使用NUnit 3在Atlassian Bamboo中运行NUnit Runner? [英] How to run NUnit Runner in Atlassian Bamboo with NUnit 3?

查看:155
本文介绍了如何使用NUnit 3在Atlassian Bamboo中运行NUnit Runner?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Atlassian Bamboo(最新版本)中使用了NUnit Runner和NUnit 2,但是升级到NUnit 3后,它不再起作用. NUnit 3中的命令行似乎有所更改.有人知道如何使Atlassian Bamboo中的NUnit 3能够工作吗?还是NUnit开发人员可以为这一重大更改考虑向后兼容性?

I used NUnit Runner in Atlassian Bamboo (latest version) with NUnit 2 but after upgrading to NUnit 3 it is no longer working. It appears something changed with the command line in NUnit 3. Anyone know how to make NUnit 3 work in Atlassian Bamboo? Or could the NUnit devs consider backward compatibility for this breaking change?

我收到以下错误:

无效的参数: -xml = TestResults-Rev_02f5436a0a70cd539bd3b77218fb48cbe3262954-Build_12.xml

Invalid argument: -xml=TestResults-Rev_02f5436a0a70cd539bd3b77218fb48cbe3262954-Build_12.xml

推荐答案

最简单的解决方案是创建一个替换-result的-xml参数的bat文件.

The simplest solution is to create a bat file that replaces -xml argument to --result.

在Nunit运行程序目录中创建一个bat文件(默认情况下为C:\ Program Files(x86)\ NUnit.org \ nunit-console),然后将休整行复制到其中.

Create a bat file in Nunit runner directory (by default C:\Program Files (x86)\NUnit.org\nunit-console) and copy the fallowing lines into it.

@echo off 
SET "var=%*"
CALL SET var=%%var:-xml=--result%%
nunit3-console.exe %var%;format=nunit2

然后使用bat文件地址作为Nunit运行程序的可执行路径.

Then use the bat file address as Nunit runner executable path.

这篇关于如何使用NUnit 3在Atlassian Bamboo中运行NUnit Runner?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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