Build/Test Issues

Run tests serially for SpecFlow-tests assembly only

Started by smoove on 6,027 views

Hi Remcrunch, hope you're well.

Is there a way to instruct NCrunch to run all tests from one assembly serially, but for all other assemblies to run in parallel?

I tried to apply the Serial / ExclusivelyUses attribute at assembly level, but nc didn't pick it up (interestingly, if you apply an NUnit category at assembly level, that category does get listed in the Categories column of the tests window for all tests in that assembly).

Another option would be to attribute each test, but with Specflow the tests are auto-generated, so you would need to jump through hoops with writing and registering a custom SpecFlow test-provider plugin.

So I would imagine that the easiest way to get this behaviour would be to detect the Serial / ExclusivelyUses attribute at assembly level.

Thanks,

Smoove
Hi Smoove,

Great to hear from you! Support for NCrunch attributes at assembly level is much requested and I hope to have this implemented soon, ideally in the maintenance release due out in a few weeks time.

Unfortunately my SpecFlow knowledge is very limited, so I'm afraid I can't suggest an easy workaround with much confidence, but I understand that the generated SpecFlow files themselves are partial classes. Would it perhaps be possible to introduce partial siblings side-by-side which either declare the ExclusivelyUsesAttribute or inherit from a base class that does?


Cheers,

Remco
Yeah, that worked (good thinking). But there would be a bunch of work to define all those partial classes, and make sure they'd stay in sync with the generated classes. So I will await the maintenance release.

Cheers, and keep up the good work.
Nice one Remco - the new release works as advertised and solves this issue.

Post a reply

Log in to reply.