Feature Suggestions

Run tests sequentially

Started by jgauffin on 10,221 views

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)

Edited

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
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.

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.

Edited

Post a reply

Log in to reply.