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

Notification

Icon
Error

FSharp Xunit tests in module without traits stuck in pipeline
mschinzpb
#1 Posted : Tuesday, March 25, 2014 1:04:50 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/25/2014(UTC)
Posts: 7
Location: United Kingdom

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
The problem I am seeing is that after upgrading to version 2.5.0.12 there is a change in behaviour in regards to running xunit facts. It used to be possible to just add the attribute to any method and this would be picked up by ncrunch and run fine.
The behaviour I am seeing after the upgrade is that facts that are in either a module or a type that is not decorated with any attributes will be added to the pipeline (the little icon at the bottom of vs shows the count and i can see them in the queue window), but are never actually run. When I then add the Trait attribute with a key "Category" and any value these tests will be picked up fine and get run by the engine.

From my understanding it is a specific choice by the developers of xunit to be able to declare tests without the ceremony of having to have a test class or container to house them in. I think this is a step backwards in the scope of ncrunch and would hope for clarification on this matter.
I would like to add that it took me a while to figure this out by myself, so hopefully you could add something to the known issues or some such where google might turn up a result for others.
Remco
#2 Posted : Tuesday, March 25, 2014 9:36:53 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this issue.

NCrunch hasn't introduced any changes around xunit integration for a very long time... So I suspect that there is more to this issue that would immediately seem to be the case.

Can you check that you aren't working inside a custom engine mode that has deliberately excluded tests adorned with a particular category?

Does this issue appear for you if you create a blank project and try to create a new xunit test with the structure that you've described?
mschinzpb
#3 Posted : Wednesday, March 26, 2014 9:29:26 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/25/2014(UTC)
Posts: 7
Location: United Kingdom

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Hey Remco,
Thanks for getting back about this. I'm a bit swamped atm, but I should have a demo solution with you after the weekend.
To answer your question: Run all tests automatically default engine.
mschinzpb
#4 Posted : Wednesday, March 26, 2014 10:48:04 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/25/2014(UTC)
Posts: 7
Location: United Kingdom

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Hey Remco, managed to squeeze 15 min today, so here is the repo with the sample:
https://github.com/mschinz/xunitncrunchtest.git
Let me know if you can reproduce there.
Cheers,
M
Remco
#5 Posted : Wednesday, March 26, 2014 9:42:47 PM(UTC)
Rank: NCrunch Developer

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

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

Thanks for sending through the sample solution.

Unfortunately, the code inside the solution seemed to work for me. All tests were detected and run. I tried it on several machines, but received the same result.

I think that something has changed in the configuration of your machine that may have triggered this problem. You mentioned earlier that this issue appeared for you after you upgraded NCrunch. Does downgrading back to your original version make any difference?

Have you installed any significant updates recently around .NET, VS, or FSharp?

Under the directory 'C:\Users\USER\AppData\Roaming\NCrunch' you'll find a file called v2_globalconfig.crunch.xml. If you delete this file with VS closed, it should restore your global NCrunch settings to their default values. This could also be something worth trying as it would rule out whether there a change in your global configuration may have surfaced this problem.
1 user thanked Remco for this useful post.
mschinzpb on 3/27/2014(UTC)
mschinzpb
#6 Posted : Thursday, March 27, 2014 4:13:57 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/25/2014(UTC)
Posts: 7
Location: United Kingdom

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Hey Remco,
Thank You for your supporting this issue.
I'm quite a bit embarrassed, as I have had a filter for category unit in my settings.
Consider this as resolved, and please accept my apologies,
Martin
1 user thanked mschinzpb for this useful post.
Remco on 3/27/2014(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.043 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download