Unable to run SpecFlow+ tests in Azure Devops release pipeline

0

I am attempting to run a SpecFlow+ test for a .net core project in an Azure Devops release pipeline however my Visual Studio Test task always fails with the following...

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.

I've no idea what this is referring to. This package Microsoft.VisualStudio.TestPlatform doesn't exist in any of my projects and the issue doesn't occur locally.

It could be related to the agent but I've tried both a hosted and private agent with the same result

The hosted agent specification is set to windows-2019 and the Test Platform Version on the Visual Studio Test task is set to Visual Studio 2019 (I've also tried latest)

When attempting to use a private agent I added a preceding Visual Studio test platform installer task with the version set to Latest Stable. The VS test task then had the platform set to Installed by Tools Installer

Anyone know what the issue could be here?

asp.net-core
azure-devops
azure-pipelines
specflow
azure-pipelines-release-pipeline
asked on Stack Overflow Feb 9, 2021 by Konzy262

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0