还有什么需要得到托管生成控制器运行我的NUnit的测试 [英] What else is needed to get the Hosted Build Controller to run my NUnit tests

查看:289
本文介绍了还有什么需要得到托管生成控制器运行我的NUnit的测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法得到的Visual Studio Online的托管生成控制器,尽管按照给出的说明来运行我的NUnit的测试的添加组件自定义活动和其他单元测试框架添加所需的NUnit的二进制文件,使编译器意识到它们的存在。

I am unable to get Visual Studio Online's Hosted Build Controller to run my NUnit tests despite following the instructions given in "Add assemblies for custom activities and other unit test frameworks" to add the required NUnit binaries and making the build controller aware of them.

我想这一切首先在Git项目,并不能得到它的工作,尽管<一个信息href=\"http://stackoverflow.com/questions/20027235/visual-studio-online-ci-nunit-tests-not-found-during-build\">Visual Studio在线CI NUnit的构建在测试过程中没有发现。

I tried all this first in a Git project and couldn't get it to work, despite the information in Visual Studio Online CI Nunit Tests not found during build.

我现在的工作是在一个TFVC项目,所以实际上托管生成控制器无法从混帐拉不应该是一个因素。

My current efforts are in a TFVC project, so the fact that the hosted build controller is unable to pull from Git shouldn't be a factor.

我使用该项目是一个简单的类库,没有code,但code。通过项目向导自动添加。测试项目是类似的:使用向导添加一个新的测试项目中,增加了NUnit的包,并增加了新的测试类引用NUnit的框架,而不是MS之一。在IDE中测试运行正确地显示两个单元测试: TestMethod1 这是由向导添加和加入 NUnit_TestMethod1 由我在新的测试类。当我运行所有,这两个测试运行:

The project I am using is a simple class library, no code but the code automatically added by the project wizard. The test project is similar: used the wizard to add a new test project, added the NUnit package and added a new test class referencing the NUnit framework rather than the MS one. In the IDE the test runner correctly shows two unit tests: TestMethod1 which was added by the wizard and NUnit_TestMethod1 which was added by me in the new test class. When I "Run all", both tests are run:

一切似乎很好,很正常。然而,当我使用托管生成控制器上运行的Visual Studio Online中生成,只有MS测试执行:

All seems fine and dandy. However, when I run a build on Visual Studio Online using the Hosted Build Controller, only the MS test is executed:

当我删除参考MS测试框架并调整UnitTest1类NUnit的属性的属性时,IDE再次能够看到并同时运行(它重新发现TestMethod1由一个蓝色的图标表示TestExplorer运行前测试),但托管生成控制器然后报告没有找到试验。

When I remove the reference to the MS test framework and adjust the attributes in the UnitTest1 class to the NUnit attributes, the IDE is again able to see and run both (it "rediscovered" TestMethod1 as indicated by a blue icon in the TestExplorer before running the tests), but the hosted build controller then reports "No tests found.":

构建控制器属性使用椭圆形按钮被设置的自定义组件版本控制路径(这样的Visual Studio决定什么放在那里),并设置为 $ /北京交大微联软件TFVC / CustomBinaries 。构建的诊断日志显示自定义二进制文件得到

The "Version control path to custom assemblies" of the build controller properties was set using the ellipses button (so Visual Studio decided what to put there) and is set to $/BJM Software TFVC/CustomBinaries. The build's diagnostics log shows that the custom binaries are "gotten":

其他信息:


  • 我使用的是默认的生成定义。在这个意义上,我只能就所使用的构建脚本改变了它(虽然这并不使不同的盲位)默认。

  • 我使用的是TfvcTemplate.12.xaml构建脚本。

  • 构建脚本有 ** \\ *测试* .DLL ** \\ *。*测试.appx 作为测试源SPEC(这是不变的默认)

  • 运行设置为无运行设置文件和运行设置默认类型。

  • I am using a "default" build definition. "Default" in the sense that I only changed it with regard to the build script used (though that doesn't make a blind bit of difference).
  • I am using the TfvcTemplate.12.xaml build script.
  • The build script has **\*test*.dll;**\*test*.appx as the test sources spec (which is unchanged from the default).
  • Run settings are "no run settings file" and "default type of run settings".

我的nunit.framework.dll中硬引用第一次尝试为好。该编译罚款(即NUnit的code是由编译器发现的),但没有运行测试。切换到的NuGet包没有帮助。

I tried first with "hard" references to the nunit.framework.dll as well. This compiled fine (ie the NUnit code is found by the compiler), but didn't run the tests. Switching to a NuGet package didn't help.

我在想什么?做些什么,我需要做的就是Visual Studio的在线托管生成控制器运行我的NUnit的测试?

What am I missing? What else do I need to do to get the Hosted Build Controller of Visual Studio Online to run my NUnit tests?

推荐答案

胜利是由


  • 将包中的NuGet为VS2012和VS2013 NUnit测试适配器该项目包含单元测试

日志现在显示2测试(S)的2过去了。

The logs now show "2 of 2 test(s) passed".

Pffff。

添加测试适配器套件也让我从删除版本控制路径的自定义组件构建控制器属性的 $ /北京交大微联软件TFVC / CustomBinaries 路径

Adding the Test Adapter package also allowed me to remove the $/BJM Software TFVC/CustomBinaries path from the "Version control path to custom assemblies" of the build controller properties.

这篇关于还有什么需要得到托管生成控制器运行我的NUnit的测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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