Add parameter to ensure tests run in sequence regardless of when build completes
See original GitHub issueAs initially reported in https://github.com/Microsoft/vstest/issues/1966, there isn’t currently a way to prevent dotnet test
from running separate test assemblies in parallel when this is not desirable behaviour.
@ShreyasRmsft suggested that adding a new parameter to the cli that would ensure tests run in sequence regardless of when build completes would enable this.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Controlling execution order of unit tests in Visual Studio
In Solution Explorer, right click on the unit test project, click Add>OrderedTest. Doing this adds a new file to the project. When you...
Read more >Run unit tests with Test Explorer - Visual Studio (Windows)
Learn how to run tests with Test Explorer in Visual Studio. This topic covers how to enable automatic test runs after build, view...
Read more >How To Set Test Case Priority In TestNG With Selenium
When you have multiple test cases and want them to run in a particular order, you can use the Priority attribute to set...
Read more >Run/Debug configuration: JUnit - IntelliJ IDEA
JUnit run/debug configurations define how unit tests that are based on the JUnit testing framework should be run.
Read more >unittest — Unit testing framework
It checks for a specific response to a particular set of inputs. unittest provides a base class, TestCase , which may be used...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Setting the MSBuild property
BuildInParallel=false
seems to work fordirs.proj
(using Microsoft.Build.Traversal), though it doesn’t seem to work for*.sln
files. Given the followingdirs.proj
:If you run
dotnet test -p:BuildInParallel=false dirs.proj
, each test project will be run in sequence. However,dotnet test -p:BuildInParallel=false foo.sln
still executes test projects in parallel.The documentation for the
-m
option can be found on the MSBuild command-line reference. It controls the number of concurrent processes used to execute the build, so-m:1
would limit the build to one process.More broadly, the dotnet build/test/restore/publish commands flow through many of these MSBuild parameters to the underlying invocation of MSBuild, which is why this works. There’s more documentation about this here.