问题
I am developing a MSTest framework based unit test project. The issue I have is I am not able to run the test in parallel and it is running sequentially. I have added the below line in my testsettings file.
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<MaxCpuCount>0</MaxCpuCount>
</RunConfiguration>
</RunSettings>
and when I run the command
vstest.console.exe C:\Git\Test.dll /TestCaseFilter:"TestCategory=Flow1|TestCategory=Flow2|TestCategory=Flow3" /settings:C:\Git\UIRunSettings.runsettings
the test are running one by one and not in parallel. Any thoughts would be much helpful.
EDIT I believe I am facing the same issue as stated in the link.
https://johnkoerner.com/vs2015/parallel-test-execution-in-visual-studio-2015-update-1-might-not-be-what-you-expect/
But dont know whats the exact resolution the author proposes.
Is the test need to be run at the solution level? Any pointers would be much helpful
All the tests has been categorised and I am finding only the test mentioned in the TestcaseFilter getting picked up......Confused was what I need to do next?
Any MS guys, can you please help. I believe more documentation is necessary for the testing community rather than a one paragraph documentation about runsettings parallel run.
Can any body please let me know. Confused again by hearing the word containers and assemblies...DO I need to create a separate DLL for each of the test methods???
Any help is much appreciated.
回答1:
Your tests need to be in separate assemblies (DLLs) in order to be run in parallel.
来源:https://stackoverflow.com/questions/37826137/unable-to-run-mstest-in-parallel-in-visual-studio-update1