I have a suite of NUnit tests and I am using Jenkins and MSBuild to run them. I have a number of test categories and sometimes I want to run just one category and other times all of them. Category parameter is provided from Jenkins.
I have a problem when I want to run all categories. If category is not provided I get this condition where: cat==
and build fails.
If category is provided everything is fine.
Is there a way to tell nunit console to run all tests categories? Something like where: cat==*
.
The NUnit console option --where
takes an argument written in Test Selection Language. (TSL) Like any other computer language, it has it's own syntax and you get errors if you don't follow it. The expression cat==
is not legal TSL. It's just as if you wrote if (cat==)
in a C# program.
If you don't want to do any category selection, then you should simply not use cat==
in your where clause. If you don't want to do any selection at all but just to run all tests, then you shouldn't be using --where
on the command-line.
If Jenkins is actually creating the command-line for you, then you have to figure out how to tell it to not use the --where
option. I don't use Jenkins, but I would bet that there docs tell you how to do it. Most CI systems I have used do it by simply not filling anything in the space where you enter categories.