You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retrieving a test's resulting ParallelScope combined from assembly, fixture and test level Parallelizable and NonParallelizable attributes missing?
I have a test which shall slightly change its behavior depending on whether it is executing in parallel with other tests. Pseudo code:
if (executing in parallel)
use dynamic ephemeral port to run local socket test
else
use fixed default port to run local socket test
Rationale:
CI/Standard use case: Running multiple socket tests in parallel requires servers to use different local ports.
Devel/Debug use case: Running single socket test is easier to debug when using fixed port.
As Parallelizable and NonParallelizable can be applied to assembly, fixture or test level, I have tried finding a way to retrieve the resulting ParallelScope:
Searched documentation and issues.
Tried to retrieve from TestContext as well as as internal TestExecutionContext.
See attached project which trace outputs the ParallelScope based on the test's Properties. However, only the test's attributes are replicated in the Properties, not the resulting ParallelScope combined from assembly, fixture and test level. Is this information available elsewhere?
Also tried TestExecutionContext.CurrentContext.ParallelScope but that returns ParallelScope.Default in all cases expect TestFixtureParallelizable.TestParallelizable where ParallelScope.Children is returned.
And there is no TestExecutionContext.CurrentContext.CurrentText.ParallelScope that could hold the value for the current test.
Retrieving a test's resulting
ParallelScope
combined from assembly, fixture and test levelParallelizable
andNonParallelizable
attributes missing?I have a test which shall slightly change its behavior depending on whether it is executing in parallel with other tests. Pseudo code:
Rationale:
As
Parallelizable
andNonParallelizable
can be applied to assembly, fixture or test level, I have tried finding a way to retrieve the resultingParallelScope
:TestContext
as well as as internalTestExecutionContext
.See attached project which trace outputs the
ParallelScope
based on the test'sProperties
. However, only the test's attributes are replicated in theProperties
, not the resultingParallelScope
combined from assembly, fixture and test level. Is this information available elsewhere?RetrieveParallelScope.zip
The text was updated successfully, but these errors were encountered: