开发者

TeamCity stopped working once I added NUnit to the mix

开发者 https://www.devze.com 2022-12-23 16:07 出处:网络
I\'m struggling a lot trying to get our build server going.I am currently running tests in a Windows XP virtual machine, and have installed TeamCity v5.0.3, build 10821.I am using NUnit v2.5.3.

I'm struggling a lot trying to get our build server going. I am currently running tests in a Windows XP virtual machine, and have installed TeamCity v5.0.3, build 10821. I am using NUnit v2.5.3.

I finished the initial setup with TeamCity without any issues at all, provided that I use the sln2008 build runner that makes the entire process almost brainless. It's really quite nice that way, and very satisfying to see your first successful automated build.

Now it's time to kick it up a notch and I wanted to get 开发者_如何学PythonNUnit working. I keep the NUnit 2.5.3 assemblies in an external libs folder in SVN, so I checked that out onto the test system. I selected NUnit 2.5.3 from the build runner options, as the online instructions had recommended. But when I build, I get the following error:

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?)

Everything compiles great in the IDE.

From finding blog posts and submitting comments, I got some advice and confirmed the following:

  • I have the HintPath value set properly in my project file (points to the external lib)
  • I can also do a full Release and Debug build from the command line using msbuild
  • I have tried do use the NUnit installer so nunit.framework.dll gets registered into the GAC
  • I have changed the build agent's logon account to be a user on the test system, rather than LOCAL SYSTEM.

Nothing seems to help... can anyone else here offer me some advice on what to try next?


I have gotten this to work, but not in the configuration that I really want. It turns out that on my machine, for whatever reason, when I installed NUnit 2.5.3, nunit.framework.dll was not registered in the GAC.

You can figure this out by entering gacutil /l | find /i "nunit" at the VS2008 command prompt. So I just installed it with gacutil /i.

Then I re-ran the sln2008 build runner, and it completed okay.

I just realized that while the build completed, TC's NUnit runner failed to actually execute any unit tests. It basically told me that the "...\bin\debug doesn't exist". ???

Unfortunately, what I really need is for this to work without NUnit in the GAC, because I have all of my systems referencing nunit.framework.dll in an external libs folder that is saved in SVN.

Currently, my options are:

  • ensure that all systems have the same version of NUnit installed (in the same location, too?)
  • have TeamCity somehow uninstall and then reinstall nunit.framework.dll from SVN every time it does a build

UPDATE

I finally figured it out. Another user error... I only looked at the short log to try to determine my problem, and only after looking at the full log did I realize that my relative path to nunit.framework.dll was wrong. Once I did that (and also had to specify all assemblies to have NUnit test), everything built and my tests are now running. This is pretty sweet!

0

精彩评论

暂无评论...
验证码 换一张
取 消