testing - Azure DevOps Pipeline vstest.failed 即使所有单元测试都通过了 locallt

标签 testing visual-studio-code azure-pipelines

有几个test.cs文件,其中一个在本地VS中完全通过了测试。但是当我 checkin TFS 时,它启动了 Pipeline 中的 CI 构建,我在其中遇到了 vstest 错误。我不知道为什么在我本地 VS 中通过的那些测试失败了。 这是我的测试程序集和一些警告日志。

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.

最佳答案

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.

以及您设置的测试内容文件:

enter image description here

此设置!**\*TestAdapter.dll可能会导致其他程序集潜入搜索路径。尝试将测试组件调整为以下内容:

!**\*TestAdapter*.dll

关于testing - Azure DevOps Pipeline vstest.failed 即使所有单元测试都通过了 locallt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71390380/

相关文章:

perl - 仅当安装了所需的模块时,如何才能在我的 Perl 模块的测试套件中运行测试?

javascript - TypeScript 执行顺序不一致

python - 如何配置 pylint/python 来检查 MicroPython 语法?

wordpress - 仅针对更改的文件增量构建 VSTS (Wordpress)

testing - 在 TechTalk SpecFlow 中,如何放弃场景?

java - Android Studio 1.1.0 + Robolectric 2.4 导致 java.lang.annotation.AnnotationFormatError

css - 需要使用 selenium 帮助的自动化 Web 测试

python - VSCode 折叠文档字符串 Python MacOS

azure - 必须为管道分离 YAML 文件

Azure devops dependentabot.yml 中的 NPM 身份验证