-
Notifications
You must be signed in to change notification settings - Fork 341
Description
Description
On AzureDevOps images windows-latest and windows-2022 you can run into No suitable test runtime provider was found for any source in this run.
error.
This error is caused by additional dlls that were ignored in 17.5.0, being incorrectly passed on in 17.6.0.
To replicate this issue you need to be on 17.6.0 version of TestPlatform, and provide more dlls than what you are testing, for example by using the default assembly filter in AzureDevOps:
**\*test*.dll
!**\*TestAdapter.dll
!**\obj\**
This filter will match .NET Standard and .NET Portable dlls, that are coming from your test adapter, and incorrectly pass them to be executed. In 17.5.0 those dlls would be silently ignored, but in 17.6.0 they fail to resolve the runtime provider and fail the run.
Workaround 1
Reduce your filter to only match the test dlls, and nothing more, for example if your test dlls use the following naming convention:
MyProduct.UnitTests.dll
MyProduct.IntegrationTests.dll
MyOtherProduct.Unit.Test.dll
You can use:
**\bin\**\*Tests.dll
**\bin\**\*Test.dll
Workaround 2
Use TestPlatform Installer task to install VSTest 17.5.0 (or 17.6.2), and instruct your vstest task to use it:
# Install VSTest 17.5.0
- task: VisualStudioTestPlatformInstaller@1
inputs:
packageFeedSelector: 'nugetOrg'
versionSelector: 'specificVersion'
testPlatformVersion: '17.5.0'
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
# ------------ Use the version installed by installer -----------
vsTestVersion: 'toolsInstaller'