Azure devops Azure devops未运行xunit测试

Azure devops Azure devops未运行xunit测试,azure-devops,Azure Devops,在测试运行日志中,我有rununittests步骤,该步骤使用visualstudio测试。但是,我看到日志消息: 在C:\stuff\Debug\x64\bin\x86\ilc\MyApp.test.dll中没有可用的测试。一些\u其他\u dll确保已注册测试发现者和执行者,并且平台和框架版本设置适当,然后重试。 测试在VisualStudio中可见,我可以运行所有这些测试(我有50多个测试)。 我已安装xunit.runner.visualstudio包。我缺少什么,为什么Azure忽略我

在测试运行日志中,我有
rununittests
步骤,该步骤使用
visualstudio测试
。但是,我看到日志消息:

在C:\stuff\Debug\x64\bin\x86\ilc\MyApp.test.dll中没有可用的测试。一些\u其他\u dll确保已注册测试发现者和执行者,并且平台和框架版本设置适当,然后重试。

测试在VisualStudio中可见,我可以运行所有这些测试(我有50多个测试)。 我已安装xunit.runner.visualstudio包。我缺少什么,为什么Azure忽略我的测试

**************** Starting test execution *********************
\vstest.console.exe "@C:\path\fadisfjla.tmp"
Microsoft (R) Test Execution Command Line Tool Version 16.4.0
Copyright (c) Microsoft Corporation.  All rights reserved.
vstest.console.exe "C:\dir\Release\x64\bin\arm\MyApp.Test\testhost.dll"
"C:\dir\Release\x64\bin\arm\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll"
"C:\dir\Release\x64\bin\arm\ilc\MyApp.Test.dll"
"C:\dir\Release\x64\bin\x86\MyApp.Test\testhost.dll"
"C:\dir\Release\x64\bin\x86\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll"
"C:\dir\Release\x64\bin\x86\ilc\MyApp.Test.dll"
/Settings:"C:\tmp\fadslfj.tmp.runsettings"

/EnableCodeCoverage
/Logger:"trx"
/TestAdapterPath:"C:\dir\Release\x64"
Starting test execution, please wait...
Test run will use DLL(s) built for framework .NETFramework,Version=v4.0 and platform X86. Following DLL(s) do not match framework/platform settings.
testhost.dll is built for Framework .NETStandard,Version=v1.4 and Platform AnyCPU.
xunit.runner.visualstudio.uwp.testadapter.dll is built for Framework .NETCore,Version=v5.0 and Platform AnyCPU.
MyApp.Test.dll is built for Framework .NETFramework,Version=v4.0 and Platform ARM.
testhost.dll is built for Framework .NETStandard,Version=v1.4 and Platform AnyCPU.
xunit.runner.visualstudio.uwp.testadapter.dll is built for Framework .NETCore,Version=v5.0 and Platform AnyCPU.
Go to more details on managing these settings.
Microsoft (R) Coverage Collection Tool Version 16.0.30319.200


Copyright (c) Microsoft Corporation.  All rights reserved.




1.5873
A total of 6 test files matched the specified pattern.
No test is available in C:\dir\Release\x64\bin\arm\MyApp.Test\testhost.dll C:\dir\Release\x64\bin\arm\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll C:\dir\Release\x64\bin\arm\ilc\MyApp.Test.dll C:\dir\Release\x64\bin\x86\MyApp.Test\testhost.dll C:\dir\Release\x64\bin\x86\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll C:\dir\Release\x64\bin\x86\ilc\MyApp.Test.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Microsoft (R) Coverage Collection Tool Version 16.0.30319.200


Copyright (c) Microsoft Corporation.  All rights reserved.




Results File: C:\path\fdsfdsfd.trx
Attachments:
  C:\path\file-dfsfdsfe.coverage
Vstest.console.exe exited with code 0.
在我的项目文件中


    <PackageReference Include="xunit.runner.visualstudio">
      <Version>2.4.1</Version>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>

2.4.1
运行时间;建设;本地人;内容文件;分析仪;可传递的
全部的

首先,确保已添加
xunit.runner.visualstudio
包。然后确保已在
Visual Studio测试任务中的
test selection/test files
下指向生成的测试程序集,例如:

**\bin\$(BuildConfiguration)\**\*test*.dll
!**\obj\**
!**\xunit.runner.visualstudio.testadapter.dll
!**\xunit.runner.visualstudio.dotnetcore.testadapter.dll
检查以下链接:


首先,确保已添加
xunit.runner.visualstudio
包。然后确保已在
Visual Studio测试任务中的
test selection/test files
下指向生成的测试程序集,例如:

**\bin\$(BuildConfiguration)\**\*test*.dll
!**\obj\**
!**\xunit.runner.visualstudio.testadapter.dll
!**\xunit.runner.visualstudio.dotnetcore.testadapter.dll
检查以下链接:


事实证明,如果您有适用于Windows版本
1803
的UWP项目,并且在该版本中将其从测试项目中引用,则会忽略测试项目中的所有测试。我认为这是xunit或windows sdk中的问题。如果将just test project更新为
1903
,它将完美地工作。

结果是,如果您有适用于Windows版本
1803
的UWP project,并且在此版本中将其从test project中引用,它将忽略test project中的所有测试。我认为这是xunit或windows sdk中的问题。如果just test project被更新为
1903
,它将完美地工作。

您是如何设置
Visual Studio test
任务的?您可以分享详细的日志吗?我已经包括了日志您是如何设置Visual Studio测试任务的?你能分享详细的日志吗?我已经包括了登录日志,我可以看到“6个程序集”符合规范,并且里面没有找到测试。我还可以看到xunit.runner.visualstudio安装在测试项目中。是否在项目的packages.config文件中添加
xunit.runner.visualstudio
?您似乎共享了本地日志,能否在DevOps构建中共享日志?我的项目没有packages.config文件,我正在项目文件中使用
。日志文件来自azure,但我已更改了所有路径和其他敏感信息。您可以尝试使用NuGet Package Manager将
xunit.runner.visualstudio
添加到您的项目中,并创建新的生成管道以查看结果。您的问题进展如何?您是否尝试过使用NuGet Package Manager将
xunit.runner.visualstudio
包添加到您的项目中并创建新的构建管道?在日志中,我可以看到“6个程序集”符合规范,并且在其中未找到任何测试。我还可以看到xunit.runner.visualstudio安装在测试项目中。是否在项目的packages.config文件中添加
xunit.runner.visualstudio
?您似乎共享了本地日志,能否在DevOps构建中共享日志?我的项目没有packages.config文件,我正在项目文件中使用
。日志文件来自azure,但我已更改了所有路径和其他敏感信息。您可以尝试使用NuGet Package Manager将
xunit.runner.visualstudio
添加到您的项目中,并创建新的生成管道以查看结果。您的问题进展如何?您是否尝试过使用NuGet Package Manager将
xunit.runner.visualstudio
包添加到项目中并创建新的生成管道?