I have yet to find a way to do this, but I am hoping it is possible:
Out of a large suite of NUnit tests, I want to satisfy these two constraints:
1. All tests should run when I am engaged in using Visual Studio/NCrunch.
2. Most tests should run on my build machine, i.e., there is a small number of tests that should not run.
In order to satisfy (2), I use NUnit's Ignore attribute. But NCrunch honors that attribute and also does not run those tests, violating (1).
I was experimenting with engine modes to see, for example, if I specify a particular category that might override the Ignore attribute, but apparently NCrunch considers Ignore first.
Is there any way to make NCrunch run test's decorated with Ignore ?
Remco NCrunch Developer
#4330
02 Jul 2013 02:10 UTC
Not directly - but there may be other ways to achieve your objectives.
One way is by using categories. The ease of this may depend upon how you are executing tests on your build server, but if you attribute all tests that should run on the build server with a specific attribute (i.e. [Category("BuildServer")]), you can then selectively run only these tests on the build server without needing to ignore them.
Another option is to use conditional compilation to switch off the Ignore attributes for the NCrunch test environment. For example:
#if !NCRUNCH
[Ignore]
#endif
.. You may find this more useful if you are trying to exclude a small minority of tests, as you'll need to touch less code in order to implement it.
One way is by using categories. The ease of this may depend upon how you are executing tests on your build server, but if you attribute all tests that should run on the build server with a specific attribute (i.e. [Category("BuildServer")]), you can then selectively run only these tests on the build server without needing to ignore them.
Another option is to use conditional compilation to switch off the Ignore attributes for the NCrunch test environment. For example:
#if !NCRUNCH
[Ignore]
#endif
.. You may find this more useful if you are trying to exclude a small minority of tests, as you'll need to touch less code in order to implement it.
Edited 02 Jul 2013 02:11 UTC
Post a reply
Log in to reply.