Jamie Rees
Jamie Rees

Reputation: 8183

Running ReSharper Tests in Parallel by NameSpace

I am wondering if I can run my NUnit tests in parallel, I'm using the R# test runner and there is the option of running assemblies in parallel.enter image description here

I have a Test Project with all of the tests and they are all 'grouped' and ordered by namespace. Is there any ability to be able to run tests in namespaces in parallel? Example of what I mean by 'grouping'enter image description here

Upvotes: 5

Views: 2895

Answers (2)

Willem Jan Gerritsen
Willem Jan Gerritsen

Reputation: 76

Nunit has its own way of parallelizing test execution:

Use the attribute Paralellizable, which can be used on assembly, class or method level. So unfortunately not on namespace level.

Just have a class in the assembly like GlobalSetup.cs:

using NUnit.Framework;
[assembly: Parallelizable(ParallelScope.All)]
[assembly: LevelOfParallelism(1)]

In the .runsettings file one can override the number of workers:

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>  
    <NUnit>
        <NumberOfTestWorkers>5</NumberOfTestWorkers>
    </NUnit>
</RunSettings> 

Upvotes: 0

Saifur
Saifur

Reputation: 16201

I would go with the NUnit console and that gives you some commandline options to run the tests by specifying TestFixtures

nunit /fixture:NUnit.Tests.AssertionTests nunit.tests.dll

to load only the NUnit.Tests.AssertionTests in the nunit.tests.dll assembly. The name specified after the /fixture option may be that of a TestFixture class, or a namespace

I have never personally tested parallel execution with commandline but theoretically it can be done

See this

Upvotes: 0

Related Questions