Because we upgraded to Core 6.0 now selenium tests need to be run with vstest.console.exe.
And now when selenium tests are run, TeamCity does not get report how nay tests were executed
Before upgrade we were using xunit and following command:
@echo off
REM This is the command Teamcity executes: RunUiTests.bat -teamcity .extrefxunit.runner.console.2.4.1toolsnet452xunit.console.exe ".srctestsInDocEdge.Tests.Ui.TestsbinDebugInDocEdge.Tests.Ui.Tests.dll" -diagnostics %1 -parallel none
And report to TC looked like that:
Tests passed: 385, ignored: 14
OR
Tests failed: 10 (6 new), passed: 370, ignored: 19
But now we are using vstest and next command:
C:"Program Files (x86)Microsoft Visual Studio2022BuildToolsCommon7IDEExtensionsTestPlatformvstest.console.exe" ".srctestsInDocEdge.Tests.Ui.TestsbinDebugInDocEdge.Tests.Ui.Tests.dll" /TestCaseFilter:"DisplayName=CreateUser"
And report to TC is following:
Error message: [xUnit.net 00:02:08.66] TestCreateUser [FAIL] (new)
We installed TeamCity.VSTest.TestAdapter (v1.0.40) nuget package
But soon as we want to add flags /Logger:teamcity and /TestAdapterPath:. next error emerges:
NotSpecified: (:String) [], RemoteException
10:23:41 Error message: NotSpecified: (:String) [], RemoteException
10:23:36 + CategoryInfo : NotSpecified: (:String) [], RemoteException
10:23:36 + FullyQualifiedErrorId : NativeCommandError
10:23:36 + PSComputerName : mcdevcutn05
10:23:36
10:23:36 Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocat
10:23:36 ion. ---> System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutra
10:23:36 l, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not mat
10:23:36 ch the assembly reference. (Exception from HRESULT: 0x80131040)
10:23:36 at TeamCity.VSTest.TestLogger.TeamCityTestLogger..ctor()
10:23:36 --- End of inner exception stack trace ---
10:23:36 at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCach
10:23:36 ed, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
10:23:36 at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMar
10:23:36 k& stackMark)
10:23:36 at System.Activator.CreateInstance(Type type, Boolean nonPublic)
10:23:36 at System.Activator.CreateInstance(Type type)
10:23:36 at Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.TestPluginManager.CreateTestExtension[T](Type exten
10:23:36 sionType) in /_/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginManager.cs:line 76
10:23:36 at Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities.LazyExtension`2.get_Value() in /_/src/Mic
10:23:36 rosoft.TestPlatform.Common/ExtensionFramework/Utilities/LazyExtension.cs:line 106
10:23:36 at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.TestLoggerManager.InitializeLoggerByUri(Uri uri, Dicti
10:23:36 onary`2 parameters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs:line 367
10:23:36 at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.TestLoggerManager.Initialize(String runSettings) in /_
10:23:36 /src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs:line 171
10:23:37 at Microsoft.VisualStudio.TestPlatform.Client.TestPlatform.CreateTestRunRequest(IRequestData requestData, TestRunCri
10:23:37 teria testRunCriteria, TestPlatformOptions options, Dictionary`2 sourceToSourceDetailMap, IWarningLogger warningLogger)
10:23:37 in /_/src/Microsoft.TestPlatform.Client/TestPlatform.cs:line 112
10:23:37 at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.RunTests(IRequestData requ
10:23:37 estData, TestRunCriteria testRunCriteria, ITestRunEventsRegistrar testRunEventsRegistrar, TestPlatformOptions options,
10:23:37 Dictionary`2 sourceToSourceDetailMap) in /_/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs:line 1251
10:23:37 at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.RunTests(TestRunRequestPay
We are also unable to download custom logger from TeamCity.VSTest.TestAdapter and logger is not listed among loggers when running command
vstest.console.exe /ListLoggers
We recieve:
Microsoft (R) Test Execution Command Line Tool Version 17.9.0 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
The following Test Logger Add-Ins are available:
Microsoft.TestPlatform.Extensions.BlameDataCollector.BlameLogger
Uri: logger://Microsoft/TestPlatform/Extensions/Blame/v1
FriendlyName: Blame
Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.HtmlLogger
Uri: logger://Microsoft/TestPlatform/HtmlLogger/v1
FriendlyName: Html
Microsoft.VisualStudio.TestPlatform.Extensions.TrxLogger.TrxLogger
Uri: logger://Microsoft/TestPlatform/TrxLogger/v1
FriendlyName: Trx
Does anybody have/had same issue to recieve test execution result from vstest.console to TC?
MeGeT is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.