VSTS - Visual Studio测试任务失败,出现错误没有测试可用

时间:2017-09-22 18:45:37

标签: c# azure-devops azure-pipelines

我正在尝试在VSTS上设置ASP.NET应用程序。我在RetailerWebsite.UnitTests.dll中收到有关无测试可用的错误。

以下是日志:

2017-09-22T18:27:57.5945288Z ##[section]Starting: VsTest - testAssemblies 2017-09-22T18:27:57.5945288Z ============================================================================== 2017-09-22T18:27:57.5945288Z Task : Visual Studio Test 2017-09-22T18:27:57.5945288Z Description : Run tests with Visual Studio test runner 2017-09-22T18:27:57.5945288Z Version : 2.1.8 2017-09-22T18:27:57.5945288Z Author : Microsoft Corporation 2017-09-22T18:27:57.5945288Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=835764) 2017-09-22T18:27:57.5945288Z ============================================================================== 2017-09-22T18:27:59.9381761Z Run the tests locally using vstest.console.exe 2017-09-22T18:27:59.9381761Z ======================================================== 2017-09-22T18:27:59.9381761Z Test selector : Test assemblies 2017-09-22T18:27:59.9381761Z Test assemblies : **\RetailerWebsite.UnitTests.dll,!**\obj\** 2017-09-22T18:27:59.9381761Z Test filter criteria : null 2017-09-22T18:27:59.9381761Z Search folder : C:\agent\_work\4\s\src\RetailerWebsite.UnitTests\bin\Release 2017-09-22T18:27:59.9381761Z Run settings file : C:\agent\_work\4\s 2017-09-22T18:27:59.9381761Z Run in parallel : false 2017-09-22T18:27:59.9381761Z Run in isolation : false 2017-09-22T18:27:59.9381761Z Path to custom adapters : null 2017-09-22T18:27:59.9381761Z Other console options : /UseVsixExtensions:true 2017-09-22T18:27:59.9381761Z Code coverage enabled : false 2017-09-22T18:27:59.9381761Z VisualStudio version selected for test execution : 15.0 2017-09-22T18:27:59.9381761Z [command]C:\agent\_work\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.1.8\vswhere.exe -version [15.0,16.0) -latest -products * -requires Microsoft.VisualStudio.PackageGroup.TestTools.Core -property installationPath 2017-09-22T18:27:59.9381761Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional 2017-09-22T18:27:59.9381761Z [command]C:\Windows\System32\Wbem\WMIC.exe datafile where "name='C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe'" get Version /Value 2017-09-22T18:27:59.9381761Z 2017-09-22T18:27:59.9381761Z 2017-09-22T18:27:59.9381761Z 2017-09-22T18:27:59.9381761Z 2017-09-22T18:27:59.9381761Z Version=15.0.26720.2 2017-09-22T18:27:59.9381761Z 2017-09-22T18:27:59.9381761Z 2017-09-22T18:27:59.9381761Z 2017-09-22T18:27:59.9381761Z 2017-09-22T18:27:59.9381761Z 2017-09-22T18:27:59.9381761Z 2017-09-22T18:27:59.9381761Z 2017-09-22T18:28:00.2506608Z ======================================================== 2017-09-22T18:28:00.5943958Z [command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" C:\agent\_work\4\s\src\RetailerWebsite.UnitTests\bin\Release\RetailerWebsite.UnitTests.dll /logger:trx /UseVsixExtensions:true 2017-09-22T18:28:00.5943958Z Microsoft (R) Test Execution Command Line Tool Version 15.0.26720.2 2017-09-22T18:28:00.5943958Z Copyright (c) Microsoft Corporation. All rights reserved. 2017-09-22T18:28:00.5943958Z 2017-09-22T18:28:01.7349947Z Starting test execution, please wait... 2017-09-22T18:28:02.2974670Z Warning: No test is available in C:\agent\_work\4\s\src\RetailerWebsite.UnitTests\bin\Release\RetailerWebsite.UnitTests.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again. 2017-09-22T18:28:02.2974670Z 2017-09-22T18:28:02.3287159Z 2017-09-22T18:28:02.9536971Z ##[warning]No results found to publish. 2017-09-22T18:28:02.9693206Z ##[section]Async Command Start: Telemetry 2017-09-22T18:28:02.9693206Z ##[section]Async Command End: Telemetry 2017-09-22T18:28:02.9693206Z ##[section]Async Command Start: Telemetry 2017-09-22T18:28:02.9693206Z ##[section]Async Command End: Telemetry 2017-09-22T18:28:02.9693206Z ##[section]Async Command Start: Telemetry 2017-09-22T18:28:02.9693206Z ##[section]Async Command End: Telemetry 2017-09-22T18:28:02.9693206Z ##[section]Async Command Start: Telemetry 2017-09-22T18:28:02.9693206Z ##[section]Async Command End: Telemetry 2017-09-22T18:28:02.9693206Z ##[section]Finishing: VsTest - testAssemblies

1 个答案:

答案 0 :(得分:2)

您需要将适当的测试适配器引用为NuGet包。对于NUnit,NUnit Test Adapter就是你所追求的。