2017-09-22 111 views
1

我想在VSTS上設置ASP.NET應用程序。我收到有關的錯誤,在我的RetailerWebsite.UnitTests.dll中沒有可用的測試VSTS - Visual Studio測試任務失敗,出現錯誤沒有測試可用

下面是日誌:

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

+0

你正在使用什麼測試框架?您的測試項目是否引用該測試框架的適當測試運行器? –

+0

我正在使用NUnit 3.4.1 – Sameer

回答

2

你需要引用相應的測試適配器作爲NuGet包。對於NUnit,NUnit Test Adapter就是你所追求的。

+0

我想將這個適配器添加到我的項目? – Sameer

+0

@Sameer通過NuGet添加它作爲參考,然後確保在構建過程中恢復了NuGet引用。 –

+0

嗨我有同樣的問題,但我只是使用默認的Visual Studio測試框架。我是否也需要參考測試適配器? –

相關問題