gpt4 book ai didi

c# - VSTS - Visual Studio 测试任务失败并显示错误 No Test is available

转载 作者:行者123 更新时间:2023-11-30 16:42:42 25 4
gpt4 key购买 nike

我正在尝试在 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

最佳答案

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

关于c# - VSTS - Visual Studio 测试任务失败并显示错误 No Test is available,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46371349/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com