yujie xu
yujie xu

Reputation: 21

Azure DevOps Pipeline vstest.failed even all the unit tests are passed locallt

There are a couple of test.cs files, and one of them totally passed the test in local VS. But when I checked in TFS it starts the CI build in Pipeline where I got vstest errors. I do not know why those tests passed in my local VS failed. Here are my test assemblies and some warning logs.

VsTest - testAssemblies

2022-03-04T04:16:15.7748891Z   Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter : 14.0.2505.1
2022-03-04T04:16:17.1095350Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.AccessRightsTool\packages\MSTest.TestAdapter.1.1.18\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.AccessRightsTool\packages\MSTest.TestAdapter.1.1.18\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2022-03-04T04:16:17.4128025Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.AccessRightsTool\packages\MSTest.TestAdapter.1.1.18\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.AccessRightsTool\packages\MSTest.TestAdapter.1.1.18\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2022-03-04T04:16:17.4929738Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.AccessRightsTool\packages\MSTest.TestAdapter.1.1.18\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.AccessRightsTool\packages\MSTest.TestAdapter.1.1.18\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2022-03-04T04:16:17.8100334Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.ConditionFileLibrary\packages\MSTest.TestAdapter.1.1.18\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.ConditionFileLibrary\packages\MSTest.TestAdapter.1.1.18\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2022-03-04T04:16:18.0506287Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.ConditionFileLibrary\packages\MSTest.TestAdapter.1.1.18\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.ConditionFileLibrary\packages\MSTest.TestAdapter.1.1.18\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2022-03-04T04:16:18.1288535Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.ConditionFileLibrary\packages\MSTest.TestAdapter.1.1.18\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.Common.ConditionFileLibrary\packages\MSTest.TestAdapter.1.1.18\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2022-03-04T04:16:18.4544944Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.ITSecurityTool\packages\MSTest.TestAdapter.1.1.18\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.ITSecurityTool\packages\MSTest.TestAdapter.1.1.18\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2022-03-04T04:16:18.6957502Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.ITSecurityTool\packages\MSTest.TestAdapter.1.1.18\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.ITSecurityTool\packages\MSTest.TestAdapter.1.1.18\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2022-03-04T04:16:18.7737037Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.ITSecurityTool\packages\MSTest.TestAdapter.1.1.18\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.ITSecurityTool\packages\MSTest.TestAdapter.1.1.18\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2022-03-04T04:16:19.1559077Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.ITSecurityTool\packages\MSTest.TestAdapter.1.3.2\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.ITSecurityTool\packages\MSTest.TestAdapter.1.3.2\build\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
2022-03-04T04:16:19.2387265Z [MSTest][Discovery][D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.ITSecurityTool\packages\MSTest.TestAdapter.1.3.2\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Unable to load types from the test source 'D:\a\2\_work\29\s\SECURITY\R11.06.00\common\src\Platform.Security.ITSecurityTool\packages\MSTest.TestAdapter.1.3.2\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.

Upvotes: 2

Views: 1391

Answers (1)

Leo Liu
Leo Liu

Reputation: 76910

Azure DevOps Pipeline vstest.failed even all the unit tests are passed locallt

According to the error message:

Unable to load types from the test source Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll. Some or all of the tests in this source may not be discovered.

And the test content files you set:

enter image description here

This setting !**\*TestAdapter.dll may cause other assemblies sneak into the search path. Try adjusting the Test Assemblies to the following:

!**\*TestAdapter*.dll

Upvotes: 2

Related Questions