Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Selecting test categories using console tool
username
#1 Posted : Monday, December 19, 2016 5:11:13 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/19/2016(UTC)
Posts: 2
Location: United Kingdom

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Using the console tool I can build and execute the tests in the solution:

> NCrunch.exe "\mysolution.sln" -MaxNumberOfProcessingThreads 8 -FastLaneThreads 0

I can't figure out how to execute a subset of the tests based on test category.

In the visual studio plugin it looks like this is achieved using engine plans. But I can't find any documentation on how this is done with the console tool. I guess it is the same way but can't figure out how to select an engine mode through the console tool.

It seems a bit odd achieving this through the engine mode because:
a) it seems you can only edit this through the VS plugin (when you want to use the console tool)
b) the engine has settings that apply to continuous execution contexts and would presumably be ignored in the console tool.

Many thanks in advance for any help with this,
Barry
Remco
#2 Posted : Monday, December 19, 2016 9:43:45 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Barry,

Thanks for posting!

Under NCrunch V2, it is only possible to do this using engine modes. This is because the test filters themselves can be attached only to the engine modes. It's possible to choose an engine mode using the '/E' parameter (try '/?' for more information on how to do this).

in NCrunch V3, engine modes were rewired so that instead of being a separate settings system, they are now overrides for other settings. See Advanced Configuration for more details about this. Basically, this means you can now inject the filter straight into the command line. For example:

NCrunch.exe "\mysolution.sln" -MaxNumberOfProcessingThreads 8 -FastLaneThreads 0 -TestsToExecuteAutomatically "HasCategory 'My Category'"

For examples on how to specify this filter, you can create it using the NCrunch Configuration Window, then inspect your configuration files to see the syntax. The syntax accepted by the console tool is always the same as is written in the config file.
1 user thanked Remco for this useful post.
username on 12/20/2016(UTC)
username
#3 Posted : Tuesday, December 20, 2016 9:48:02 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/19/2016(UTC)
Posts: 2
Location: United Kingdom

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Works a charm thank you.
1 user thanked username for this useful post.
Remco on 12/20/2016(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.033 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download