_From @mixandmatch025 on November 25, 2018 15:17_
Hi, I'm trying to run all tests in a given .sln file in parallel, using either dotnet test or dotnet vstest.
Using https://dasmulli.blog/2018/01/20/make-dotnet-test-work-on-solution-files/ I managed to run all the tests, but they are running sequentially.
I did manage to use vstest to run tests in parallel, but only using .dll files.
Is there any way to achieve this?
_Copied from original issue: dotnet/cli#10389_
@livarcocc Do you mean tests within a dll are also not running in parallel? The parallel flag today is at dll level only and does not work across multiple dlls.
@prawalagarwal then I guess that's the parallelism I achieved.
Is there any CLI command to run all tests in parallel in a given solution? Similar to how visual studio is able to.
@mixandmatch025 Sorry, my last comment is not accurate. Let me explain in detail:
1) The /Parallel flag available with 'dotnet vstest' works on Assembly level only. What this means is, if you have 2 dlls, one dll will go to one process and the other dll will go to the other process. Tests within a dll will still execute sequentially.
2) 'dotnet test' already implements parallel build by default. So if you have 2 projects, the builds for these two projects happens in parallel and if the build for first project completes before the second project, the tests for the same start executing. Tests for the second project start as soon as the build for it completes. Again, tests within a project will run sequentially.
Starting 15.9.0 version of Visual studio, you don't need the work around for running sln files from dotnet cli and it is supported out of the box, with parallel builds already enabled.
If you are talking about in assembly parallel run, then please go through this post.
Starting 15.9.0 version of Visual studio
What dotnet sdk is that?
If you are talking about, in assemble parallel run, then please go through this post.
I'm using xunit for my test framework. Any posts for that? 馃槃
The SDk version is v2.1.500.
For XUnit I found this article to get started.
@prawalagarwal cool, thanks!
I see that there are several properties that can be sent to MSBuild to config parallelism. How do I pass them to dotnet test?
I will suggest this thread for more understanding here. 'dotnet msbuild' supports all parameters/configurations which msbuild supports.
thank you for your help!
dotnet test' already implements parallel build by default. So if you have 2 projects, the builds for these two projects happens in parallel and if the build for first project completes before the second project, the tests for the same start executing. Tests for the second project start as soon as the build for it completes. Again, tests within a project will run sequentially.
Sorry to come here after this long time @prawalagarwal .
How can I achieve this "launch the test for two test project in parallel" ? I am using dotnet task in azure pipelines and they seems to be done sequentially.
Most helpful comment
Sorry to come here after this long time @prawalagarwal .
How can I achieve this "launch the test for two test project in parallel" ? I am using dotnet task in azure pipelines and they seems to be done sequentially.