有几个test.cs文件,其中一个在本地VS中完全通过了测试。但是当我 checkin TFS 时,它启动了 Pipeline 中的 CI 构建,我在其中遇到了 vstest 错误。我不知道为什么在我本地 VS 中通过的那些测试失败了。 这是我的测试程序集和一些警告日志。
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.
最佳答案
Azure DevOps Pipeline vstest.failed even all the unit tests are passed locallt
根据错误信息:
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.
以及您设置的测试内容文件:
此设置!**\*TestAdapter.dll
可能会导致其他程序集潜入搜索路径。尝试将测试组件调整为以下内容:
!**\*TestAdapter*.dll
关于testing - Azure DevOps Pipeline vstest.failed 即使所有单元测试都通过了 locallt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71390380/