Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FileNotFoundException when running NUnit tests from TeamCity

I am using the built in TeamCity NUnit runner to run tests stored in .DLL files.

My .DLLs are referencing other DLLs which are present in the same folder.

When running these, i am getting a FileNotFoundException for the referenced DLLs.

How can i fix this? I am thinking perhaps the TC NUnit runner is using some other dir as the main app execution folder, and thus preventing from files that are actually residing next to the test DLL to not load properly, but cannot prove this claim yet...

Anyone else encountered this behaviour?

like image 228
lysergic-acid Avatar asked Sep 07 '11 20:09

lysergic-acid


2 Answers

OK the problem is solved and it is indeed silly and embarrassing:

I have set the NUnit test runner to execute these tests:

**/*.Tests.dll

This means that it will include tests from /bin/Debug/ and also from other folders, such as obj/

In these folders, no references are included of course, making the same tests run twice and some of these fail of course!

like image 99
lysergic-acid Avatar answered Oct 19 '22 23:10

lysergic-acid


Paths are related to build checkout directory, not to any working directory. If you need another paths, use %reference% syntax to refer to TeamCity property with a directory path. Do you run it under Windows? Do you use TeamCity 6.5?

If that does not help, feed free to contact [email protected]

like image 1
Eugene Petrenko Avatar answered Oct 20 '22 00:10

Eugene Petrenko