无法在 Azure Devops 发布管道中运行 SpecFlow+ 测试

时间:2021-02-09 19:33:41

标签: asp.net-core azure-devops azure-pipelines specflow azure-pipelines-release-pipeline

我正在尝试在 Azure Devops 发布管道中为 .net 核心项目运行 SpecFlow+ 测试,但是我的 Visual Studio Test 任务总是失败并显示以下内容...

2021-02-09T18:08:17.2287019Z **************** Starting test execution *********************
2021-02-09T18:08:17.2538855Z [command]C:\agent0\_work\_tool\VsTest\16.8.3\x64\tools\net451\Common7\IDE\Extensions\TestPlatform\vstest.console.exe "@C:\agent0\_work\_temp\gnnuzvmfeti.tmp"
2021-02-09T18:08:17.4172728Z Microsoft (R) Test Execution Command Line Tool Version 16.8.3
2021-02-09T18:08:17.4173457Z Copyright (c) Microsoft Corporation.  All rights reserved.
2021-02-09T18:08:17.4223672Z vstest.console.exe "C:\agent0\_work\r3\a\Primary\SmartAssessor.Specflow\SmartAssessor.SpecFlow.dll"
2021-02-09T18:08:17.4227084Z /TestCaseFilter:"TestCategory=Browser_Chrome"
2021-02-09T18:08:17.4227947Z /Settings:"C:\agent0\_work\_temp\cdgjenyrw40.tmp.runsettings"
2021-02-09T18:08:17.4232047Z /Logger:"trx"
2021-02-09T18:08:17.4233119Z /TestAdapterPath:"C:\agent0\_work\r3\a\Primary\SmartAssessor.Specflow"
2021-02-09T18:08:17.4239363Z /Diag:"C:\agent0\_work\_temp\Attempt--1_35nytg.diag"
2021-02-09T18:08:18.1924213Z Starting test execution, please wait...
2021-02-09T18:08:18.2118457Z Logging Vstest Diagnostics in file: C:\agent0\_work\_temp\Attempt--1_35nytg.diag
2021-02-09T18:08:18.4469704Z A total of 1 test files matched the specified pattern.
Testhost process exited with error: Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'System.Threading, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'System.Threading, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace.get_Source()
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace.ShouldTrace(PlatformTraceLevel traceLevel)
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.Error(String format, Object[] args)
   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args)
. Please check the diagnostic logs for more information.
Test Run Aborted.
Error: The process 'C:\agent0\_work\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.170.1\Modules\DTAExecutionHost.exe' failed with exit code 1
Vstest failed with error. Check logs for failures. There might be failed tests.

我不知道这是指什么。这个包 Microsoft.VisualStudio.TestPlatform 在我的任何项目中都不存在,问题也不会在本地发生。

这可能与代理有关,但我尝试了托管和私人代理,结果相同

托管代理规范设置为 windows-2019Test Platform Version 任务上的 Visual Studio Test 设置为 Visual Studio 2019(我也尝试过 latest

尝试使用私人代理时,我添加了前面的 Visual Studio test platform installer 任务,并将版本设置为 Latest Stable。然后 VS 测试任务将平台设置为 Installed by Tools Installer

有人知道这里可能有什么问题吗?

0 个答案:

没有答案