Build/Test Issues

SetUpFixture for specific namespace gets executed when running a single test in different namespace

Started by nrjohnstone on 6,682 views

The documentation for NUnit states that a class with the SetUpFixture will run once before any tests in the namespace execute.

Our integration project has a separate namespace for the databases tests and has a class with SetUpFixture to create and drop the databases as required.

However we noticed with NCrunch alot of our other non database tests are running slowly now and after debugging I've found this to be that after running a single test from a different namespace, the SetUpFixture gets executed as well, even though no tests in that namespace are being run !

Hi, thanks for posting.

Can you confirm which version of NUnit you are using?
Hi Remco, I'm using NUnit 2.6.3 with Visual Studio 2013 Update 4 and NCrunch 2.16.0.13
I've also confirmed that using the NUnit test runner to run an explicit test from a namespace outside of the one with SetUpFixture attribute and it does not get run, the same with Resharper v10. It only seems to be NCrunch that executes the SetUpFixture when running tests outside of the namespace where the SetUpFixture is supposed to apply.
Thanks. I've managed to reproduce this issue and have prepared a fixed build for you:

http://downloads.ncrunch.net/NCrunch_Console_2.18.0.1.msi
http://downloads.ncrunch.net/NCrunch_Console_2.18.0.1.zip
http://downloads.ncrunch.net/NCrunch_GridNodeServer_2.18.0.1.msi
http://downloads.ncrunch.net/NCrunch_GridNodeServer_2.18.0.1.zip
http://downloads.ncrunch.net/NCrunch_LicenseServer_2.18.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2008_2.18.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2010_2.18.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2010_2.18.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2012_2.18.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2012_2.18.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2013_2.18.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2013_2.18.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2015_2.18.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2015_2.18.0.1.zip

Give it a try, and let me know how it goes.
Brilliant Remco, that fixes the issue :-)

Thanks again for an excellent product !

Post a reply

Log in to reply.