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

Notification

Icon
Error

Run tests sequentially
jgauffin
#1 Posted : Wednesday, February 6, 2013 7:34:51 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/6/2013(UTC)
Posts: 6
Location: Sweden

Thanks: 1 times
I'm running ncrunch on a project which has integration tests and uses mstest.

The problem is that ncrunch doesn't seem to run the tests sequentially even though I've told it to do so (run one test at a time).

that results in that the DB is not setup correctly before each test = tests fail.

If I use the vstudio test runner all tests succeed.

Update

Works if I manually configure one thread in the settings (but not by using the wizard)
Remco
#2 Posted : Wednesday, February 6, 2013 9:19:08 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Hi, thanks for posting!

Sequence dependent tests are, unfortunately, something you'll need to give up on if you're to make proper use of NCrunch. There's some more details about this in the documentation.


Cheers,

Remco
jgauffin
#3 Posted : Wednesday, February 20, 2013 7:40:49 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/6/2013(UTC)
Posts: 6
Location: Sweden

Thanks: 1 times
I don't mean that the tests should run in a specific order but that only one test has to be run at a time. My current client has a codebase with a lot of integration tests. The DB is setup before each test. so running more than one test simultaneously will screw up the DB.

Remco
#4 Posted : Wednesday, February 20, 2013 8:31:30 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Ahh - so you're experiencing issues with parallelisation then?

The best way to solve this would be to make sure your integration tests are properly attributed with the NCrunch.Framework.ExclusivelyUsesAttribute. In this way, you can still have your unit tests running in parallel but let the integration tests run serially.

There's also some other options - it's well worth having a read of the documentation around parallel execution.
1 user thanked Remco for this useful post.
jgauffin on 3/4/2013(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.030 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download