Teamcity not DLL's for some NUnit Test projects
Asked Answered
A

2

13

I get this error when running my Moq tests through Teamcity 5

Test(s) failed. System.IO.FileNotFoundException : Could not load file or assembly 'Moq, Version=3.1.416.3, Culture=neutral, PublicKeyToken=69f491c39445e920' or one of its dependencies. The system cannot find the file specified. at MyCode.Tests.SomeHandlerTests.Setup()

The tests run fine on my local; they just fail on the build server.

I made sure the assemblies are in the Bin (looking at them now over RDP just be double sure).

Anomalous answered 8/9, 2010 at 7:57 Comment(0)
A
28

So the issue was to do with the Test DLL search path under the nunit settings

It was:

..\Tests\**\*Test*.dll

But is now:

..\Tests\*\bin\Debug\*Test*.dll

And things work nicely

UPDATE

http://confluence.jetbrains.com/display/TCD8/NUnit

You can use this pattern

**\*.dll

as long as you add this pattern in the "Do not run tests from" field

**\obj\**\*.dll

Anomalous answered 8/9, 2010 at 13:50 Comment(3)
Do you know why this works? I had the exact same issue, down to RDP'ing to see that it was there.Cartilaginous
@Cartilaginous - it worked for me because originally it was also picking up the /obj/ folder, which doesn't have all the required dependencies.Yaw
Same thing happened to me and as @MickieChan said it was running the tests in the /obj folder but not sure why in my case since my pattern was %system.teamcity.build.workingDir%\**\bin\%system.Configuration%*.IntegrationTests.dll so not sure why it would pick up the /obj folder. The other sign this was happening is in the build log where for each failed test it said "The test was run 2 times in the build, 1 failure".Wendiwendie
S
0

I had a similar issue, but found that I had different version's of Moq between my 2 Test projects.

The issue that I had was that the correct version was not available.

Just do

Update-Package Moq

From the Package Manager command line

Sloshy answered 23/12, 2013 at 10:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.