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

Notification

Icon
Error

Running tests that use nUnit's Explicit attribute
SolaAesir
#1 Posted : Wednesday, September 12, 2012 2:40:08 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/14/2012(UTC)
Posts: 3
Location: Twin Cities, MN, USA

I would like to manually run (integration) tests which are marked with nUnit's Explicit attribute. Right now they are not being run by the automatic runner and they aren't showing up as an ignored test. I can't find an option to run them in the solution or project configurations. How do I run these tests using nCrunch?
Remco
#2 Posted : Wednesday, September 12, 2012 8:53:06 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,975

Thanks: 929 times
Was thanked: 1257 time(s) in 1170 post(s)
At the moment, NCrunch just considers NUnit explicit tests as ignored. The reasons for this are largely historical (the first versions of NCrunch did not support manual or part continuous), although they don't really apply any more. Ideally the behaviour should be that Explicit tests are not run automatically with NCrunch, and are run manually instead. There is a task in the backlog to address this in future.

If possible, I'd recommend using an alternative to the Explicit attribute for the time being. If you're prepared to fully rely on NCrunch to run your tests, you can create your own custom category that specifies tests which should not be run continuously (using a custom engine mode).


Cheers,

Remco
NeilMacMullen
#3 Posted : Friday, July 3, 2020 12:33:35 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 12/15/2016(UTC)
Posts: 55
Location: United Kingdom

Thanks: 29 times
Was thanked: 12 time(s) in 11 post(s)
Just wondering if this feature ever got completed ? ;-) I have a few tests that are marked as Explicit (at the class level) The ideal behaviour would be if Ncrunch had a "Show Explicit tests" button next to "show Ignored" so that I could list these tests in the Test Explorer and run them manually every so often. At the moment I can't get them to display at all. I've tried adding a redundant Ignore attribute in the hope Ncrunch might notice them that way but no luck.

The best approach I've been able to come up with is to temporarily remove the Explicit flag then mark the test class as pinned from the test-explorer.

Neil
Remco
#4 Posted : Saturday, July 4, 2020 12:27:51 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,975

Thanks: 929 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi Neil,

We implemented this a few years ago. Explicit tests should be detected and marked internally with a special flag so that the engine will only run them if you specifically target them with a run action. Until then, they should be listed in the Tests Window as 'Not Run'. There is no special filter option in place for them, but there is an 'Is Explicit' column you can turn on with a True/False value.
1 user thanked Remco for this useful post.
NeilMacMullen on 7/9/2020(UTC)
NeilMacMullen
#5 Posted : Thursday, July 9, 2020 7:15:12 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 12/15/2016(UTC)
Posts: 55
Location: United Kingdom

Thanks: 29 times
Was thanked: 12 time(s) in 11 post(s)
Thanks Remco - that's great! For anyone else who was stumped by this, the trick is to add the "show unexecuted tests" button to the "Ncrunch tests" window toolbar by clicking on the down-arrow to the right of the Search box. I think there may be a minor bug here though - once you've done this the new button seems to take the place of the "Show pinned tests" button and there doesn't seem to be a way to get that back.

Neil
Remco
#6 Posted : Friday, July 10, 2020 12:27:04 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,975

Thanks: 929 times
Was thanked: 1257 time(s) in 1170 post(s)
NeilMacMullen;14859 wrote:
Thanks Remco - that's great! For anyone else who was stumped by this, the trick is to add the "show unexecuted tests" button to the "Ncrunch tests" window toolbar by clicking on the down-arrow to the right of the Search box. I think there may be a minor bug here though - once you've done this the new button seems to take the place of the "Show pinned tests" button and there doesn't seem to be a way to get that back.


There is an option on the Tests Window toolbar that allows you to show/hide the different buttons, you should be able to use this if a button is missing.
1 user thanked Remco for this useful post.
NeilMacMullen on 7/10/2020(UTC)
NeilMacMullen
#7 Posted : Friday, July 10, 2020 10:25:09 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 12/15/2016(UTC)
Posts: 55
Location: United Kingdom

Thanks: 29 times
Was thanked: 12 time(s) in 11 post(s)
>There is an option on the Tests Window toolbar that allows you to show/hide the different buttons, you should be able to use this if a button is missing.

Yes - that's what I'm using. I think my memory is playing tricks - I had thought there was also a "show pinned tests" button but obviously not.
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.078 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download