Difference between self and children scope in parallelizable

776 views
Skip to first unread message

kiran kumar

unread,
Oct 8, 2015, 12:53:56 PM10/8/15
to NUnit-Discuss
Hi 

I want some information on Parallelizable attribute. 

Self,     // the test itself may be run in parallel with other tests
Children, // child tests may be run in parallel with one another

When to use children scope. What are child tests. At what level children and self scope is used?

Eg:-

[TestFixture]
class Class1
{
[Test]
public void  Test1()
{
}

[Test]
public void  Test2()
{
}

}

In the above example are Test1 and 2 child tests?

Thanks,
Kiran.

Charlie Poole

unread,
Oct 8, 2015, 1:32:59 PM10/8/15
to NUnit-Discuss
Hi Kiran,

Children implies containment...

A parameterized test case is a child of a test method.
A test method is a child of a fixture
A fixture is a child of a namespace
A namespace may be a child of other namespaces
The top level namespace is a child of the test assembly.

Note that all of those are called "tests" when we talk about NUnit.

So yes, Test1 and Test2 are children of the fixture.

That said, it's a bit academic, since parallel execution below the
fixture level is not yet implemented. :-(

Charlie
> --
> You received this message because you are subscribed to the Google Groups
> "NUnit-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nunit-discus...@googlegroups.com.
> To post to this group, send email to nunit-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/nunit-discuss.
> For more options, visit https://groups.google.com/d/optout.

Charlie Poole

unread,
Oct 8, 2015, 1:35:04 PM10/8/15
to NUnit-Discuss
IF we implemented parallelism at the method level, putting a scope of
Children on the class would have the same effect as putting Self on
every test method.

For now, the simplest thing to do is to put a scope of Fixture on the
assembly, then add None to any fixtures that won't run in parallel.

cturner

unread,
Oct 30, 2018, 5:02:56 PM10/30/18
to NUnit-Discuss
Hi, 

Is parallelism at the method level implemented yet?

"A parameterized test case is a child of a test method." --> I need to run a parameterized test in parallel (all parameter cases of the test run parallel to each other), while maintaining sequential execution for the remaining tests in the textFixture. 

i.e. I have a TestFixture with multiple test. I want those tests to run sequentially, but each of those tests in itself to run all of their parameterized test cases in parallel. 

I was hoping this was possible with [Parallelizable(ParallelScope.Children)].
Reply all
Reply to author
Forward
0 new messages