I'm running tests solution on azure pipeline with help of vstest@2 task. Pipeline distributes test cases on 4 agents and then runs them.
Task yaml:
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**/*.Tests.dll
searchFolder: '$(System.DefaultWorkingDirectory)'
distributionBatchType: basedOnExecutionTime
runInParallel: true
On beginning of the run I get bunch of these messages :
##[error]DiscoveryMessage : Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)
and after that tests start passing and run goes further.
I have two questions about this - what does these messages actually mean / should I intervene in some way?
Can I somehow disable these messages so they dont spam my run log ?
CodePudding user response:
You can try the below workaround to resolve the above issue, instead of using **/*.Tests.dll
try to use **\*test.dll
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test.dll
searchFolder: '$(System.DefaultWorkingDirectory)'
distributionBatchType: basedOnExecutionTime
runInParallel: true
And also based on the MS DOC :
The VsTest task doesn't support running tests that target multiple target frameworks at a time as this is a limitation from the vstest platform side. If you want to run tests that belong to multiple target frameworks, you'll need multiple instances of the vstest task, one per set of dlls that target a particular framework.
For more information please refer the below links for the similar issue: