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

Notification

Icon
Error

Ncrunch is not observing the XUnit FactAttribute's Skip property
jesse10581
#1 Posted : Friday, March 22, 2019 4:23:44 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/11/2012(UTC)
Posts: 3
Location: New Jersey

Thanks: 1 times
I am trying to skip a test, for now, using XUnit's Skip property on the Fact attribute, i.e. [Fact(Skip="reason")]. The VS Test runner correctly skips this test, but NCrunch keeps running this test regardless. Is this a bug? or a feature request? Or, am I doing something wrong?

Thanks!
Remco
#2 Posted : Friday, March 22, 2019 10:13:52 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for sharing this issue.

I hope you're ok with me asking a few questions about your environment. This seems to be working correctly at my end, so there must be a variable here somewhere.

- Which version of .NET are you using? (i.e. .NET Framework, .NET Core, etc)
- Which version of Xunit are you using?
- Which version of NCrunch are you using?
- Can you share the exact syntax you're using to declare the test method?
jesse10581
#3 Posted : Friday, March 22, 2019 10:31:07 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/11/2012(UTC)
Posts: 3
Location: New Jersey

Thanks: 1 times
Ncrunch 3.24.0.5
.NET Core SDK 2.2.101 (x64)
xUnit 2.4.1
VS 2017 15.19.5

Now that I think about it, it might have to do with my custom Fact derivative that I created:

[DebugOnlyFact]
public async Task RunCashFlowSimOnOpenEnvDataAndMappedData_ResultsMatch()


And the implementation is here:

public class DebugOnlyFact : FactAttribute
{
public DebugOnlyFact()
{
#if !DEBUG
Skip = "Only run on a developer machine when building in debug mode.";
#endif
}
}


I'm sorry that I didn't even mention this! I guess I had figured that since it was working in the VS Test Runner that it must've meant that you didn't support the Skip attribute property at all.
Remco
#4 Posted : Friday, March 22, 2019 11:02:59 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
NCrunch will usually build in debug mode, so I guess it will never skip this :)
1 user thanked Remco for this useful post.
jesse10581 on 3/23/2019(UTC)
jesse10581
#5 Posted : Saturday, March 23, 2019 3:30:18 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/11/2012(UTC)
Posts: 3
Location: New Jersey

Thanks: 1 times
Thank you. I was able to get it working once you mentioned that it was building in debug mode. I found the setting in your documentation to switch that, and it properly ignores the test now. I appreciate your prompt support!
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.034 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download