I've recently updated to TeamCity 9.1.6 to run my new unit tests based on NUnit 3.2.1. But now I'm having trouble running the tests:
I've selected the NUnit3 executor in build steps, configured it accordingly:
When building, I get an error: "Could not load file or assembly 'nunit.framework' or one of its dependencies. The system cannot find the file specified.".
Everything should be fine, the paths are fine, the assembly is in the path of the Test assembly, everything is built in AnyCPU configuration. There's also the error stating that NUnit version is not a release version, which I think is bullshit, it's a release on NUnit website. And the error doesn't seem to break anything (it was present even when I had an error before the 'nunit.framework' error, and when I fixed that one, the build got further).
Any leads appreciated!
UPDATE: Running tests using a Command Line runner and running that same nunit3-console.exe works fine. So I guess this is a NUnit runner specific problem. Still, suggestions are welcome on how to fix this.
UPDATE 2: I tried downgrading both the solution package and the NUnit-Console used by TeamCity to 3.0.0 - still, same result.
UPDATE 3: As I've suspected, TeamCity support confirmed that the message about "NUnit version not being supported" is a faulty one, and shouldn't affect anything.
After a lengthy email discussion with TeamCity tech support we came to a solution. I've been notified that they've fixed this problem in the upcoming TC10 release (coming somewhere in the end of June 2016), and that for now there's a couple workarounds that will fix this.
I've tried number two, and it worked for me.
Run tests only in the nested directories relative to the checkout directory (for example you could copy them before)
Add a build configuration parameter
nunit_use_project_file
toFalse
:That is, I went to my test building and running projects, went to the Parameters section and added the new parameter "nunit_use_project_file" as False. Tests are now running under NUnit3 build step runner.