Dav*_*ave 3 teamcity continuous-integration nunit unit-testing visual-studio-2008
我正在努力让我们的构建服务器继续努力.我目前正在Windows XP虚拟机中运行测试,并已安装TeamCity v5.0.3,build 10821.我正在使用NUnit v2.5.3.
我完成了TeamCity的初始设置,没有任何问题,只要我使用sln2008构建运行器,使整个过程几乎无脑.这种方式非常好,并且非常令人满意地看到您的第一个成功的自动构建.
现在是时候把它提升一个档次了,我想让NUnit工作.我将NUnit 2.5.3程序集保存在SVN的外部libs文件夹中,因此我将其检查到了测试系统.我从构建运行器选项中选择了NUnit 2.5.3,正如在线说明所推荐的那样.但是当我构建时,我收到以下错误:
Window1.xaml.cs(14,7): error CS0246: The type or namespace name ‘NUnit’ could not be found (are you missing a using directive or an assembly reference?)
Window1.xaml.cs(28,10): error CS0246: The type or namespace name ‘Test’ could not be found (are you missing a using directive or an assembly reference?)
Window1.xaml.cs(28,10): error CS0246: The type or namespace name ‘TestAttribute’ could not be found (are you missing a using directive or an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
在IDE中,一切都很好.
通过查找博客文章和提交评论,我得到了一些建议并确认了以下内容:
似乎没有任何帮助...这里的任何人都能为我提供一些关于下一步尝试的建议吗?
我已经得到了这个,但不是我真正想要的配置.事实证明,在我的机器上,无论出于何种原因,当我安装NUnit 2.5.3时,nunit.framework.dll未在GAC中注册.
您可以通过输入gacutil /l | find /i "nunit"
VS2008命令提示符来解决这个问题.所以我刚安装它gacutil /i
.
然后我重新运行了sln2008 build runner,它就完成了.
我刚刚意识到,在构建完成时,TC的NUnit运行器未能实际执行任何单元测试.它基本上告诉我"...\bin\debug不存在".???
不幸的是,我真正需要的是在GAC中没有NUnit的情况下工作,因为我的所有系统都在一个保存在SVN中的外部libs文件夹中引用了nunit.framework.dll.
目前,我的选择是:
UPDATE
我终于弄明白了.另一个用户错误...我只看了短日志,试图确定我的问题,只有在查看完整日志后才知道我的nunit.framework.dll的相对路径是错误的.一旦我这样做(并且还必须指定所有程序集进行NUnit测试),所有构建的内容和我的测试现在都在运行.这很可爱!