Closed heilwood closed 5 years ago
@heilwood please provide full console output including version of runner.
Also what version of ReportPortal.VSTest.TestLogger
are you using?
@nvborisenko ReportPortal.VSTest.TestLogger version 1.30. Runner Version:2.147.0, here is the log:
##[section]Starting: Test Run
==============================================================================
Task : Visual Studio Test
Description :
Version : 2.147.0
Author : Microsoft Corporation
Help : [More information](https://go.microsoft.com/fwlink/?LinkId=835764)
==============================================================================
SystemVssConnection exists true
SystemVssConnection exists true
SystemVssConnection exists true
Running tests using vstest.console.exe runner.
======================================================
Test selector : Test assemblies
Test filter criteria : null
Search folder : C:\ag\_work\4\s
VisualStudio version selected for test execution : latest
Run in parallel : false
Run in isolation : false
Path to custom adapters : null
Other console options : /Logger:ReportPortal
Code coverage enabled : false
Diagnostics enabled : false
SystemVssConnection exists true
Run the tests locally using vstest.console.exe
========================================================
Test selector : Test assemblies
Test assemblies : **\Remote\*RM.Automation*.dll,!**\obj\**
Test filter criteria : null
Search folder : C:\ag\_work\4\s
Run settings file : C:\ag\_work\4\s
Run in parallel : false
Run in isolation : false
Path to custom adapters : null
Other console options : /Logger:ReportPortal
Code coverage enabled : false
Diagnostics enabled : false
Rerun failed tests: false
VisualStudio version selected for test execution : latest
========================================================
======================================================
[command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" @C:\ag\_work\_temp\647ba4e1-4655-11e9-9fd1-9d010a0beb54.txt
Microsoft (R) Test Execution Command Line Tool Version 15.0.26228.0
Copyright (c) Microsoft Corporation. All rights reserved.
`
vstest.console.exe
"C:\ag_work\4\s\Horinzon.RM.Automation\bin\Remote.Automation.dll"
/logger:"trx"
/TestAdapterPath:"C:\ag_work\4\s"
/Logger:ReportPortal
Error: Could not find a test logger with URI or FriendlyName 'ReportPortal'.
##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
##[error]Error: The process 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe' failed with exit code 1
##[warning]No results found to publish.
##[error]VsTest task failed.
##[section]Finishing: Test Run `
Try to not specify TestAdapterPath
in console arguments. Vstest does it automatically and finds logger in the folder where your test assembly is located.
Also, I saw you use SpecFlow as test framework, you might be interested in agent for SpecFlow.
Thank you for suggestion, but specflow plugin have some restrictions, like we need to use shared App Domain, is not our case. Without test adapter options:
[command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" @C:\ag\_work\_temp\647ba4e1-4655-11e9-9fd1-9d010a0beb54.txt
Microsoft (R) Test Execution Command Line Tool Version 15.0.26228.0
Copyright (c) Microsoft Corporation. All rights reserved.
`
vstest.console.exe
"C:\ag_work\4\s\Automation\bin\Remote\Automation.dll"
/logger:"trx"
/TestAdapterPath:"C:\ag_work\4\s"
/Logger:ReportPortal
Error: Could not find a test logger with URI or FriendlyName 'ReportPortal'.
##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
##[error]Error: The process 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe' failed with exit code 1
##[warning]No results found to publish.
##[error]VsTest task failed.
##[section]Finishing: Test Run `
Runner cannot find logger because this version (15.0) of runner finds loggers in the current directory. You can specify the full path to the logger (bin/debug
) where ReportPortal.VsTest.TestLogger.dll
is located, or use the newest version of runner. When I use Latest
version of Test Platform in vsts task, it uses 15.9
, which is smart enough.
I would recommend to use Visual Studio Test Platform Installer
task in pipeline to install Test Platform with specific version (usually latest), and use it in Visual Studio Test
task.
Run with you suggestion:
##[section]Starting: Test Run
==============================================================================
Task : Visual Studio Test
Version : 2.147.0
Author : Microsoft Corporation
Help : [More information](https://go.microsoft.com/fwlink/?LinkId=835764)
==============================================================================
SystemVssConnection exists true
SystemVssConnection exists true
SystemVssConnection exists true
Running tests using vstest.console.exe runner.
======================================================
Test selector : Test assemblies
Test filter criteria : null
Search folder : C:\ag\_work\4\s
Run in parallel : false
Run in isolation : false
Path to custom adapters : null
Other console options : /Logger:ReportPortal
Code coverage enabled : false
Diagnostics enabled : false
SystemVssConnection exists true
Run the tests locally using vstest.console.exe
========================================================
Test selector : Test assemblies
Test assemblies : **\Remote\*RM.Automation*.dll,!**\obj\**
Test filter criteria : null
Search folder : C:\ag\_work\4\s
Run settings file : C:\ag\_work\4\s
Run in parallel : false
Run in isolation : false
Path to custom adapters : null
Other console options : /Logger:ReportPortal
Code coverage enabled : false
Diagnostics enabled : false
Rerun failed tests: false
VisualStudio version selected for test execution : toolsInstaller
========================================================
======================================================
[command]C:\ag\_work\_tool\VsTest\15.9.0\x64\tools\net451\Common7\IDE\Extensions\TestPlatform\vstest.console.exe @C:\ag\_work\_temp\5c1f8eb1-4718-11e9-8e79-297a82dcd103.txt
Microsoft (R) Test Execution Command Line Tool Version 15.9.0
Copyright (c) Microsoft Corporation. All rights reserved.
`
vstest.console.exe
"C:\ag_work\4\s\Automation\bin\Remote.Automation.dll"
/logger:"trx"
/TestAdapterPath:"C:\ag_work\4\s"
/Logger:ReportPortal
Starting test execution, please wait...
Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'ReportPortal'.
##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
##[error]Error: The process 'C:\ag_work_tool\VsTest\15.9.0\x64\tools\net451\Common7\IDE\Extensions\TestPlatform\vstest.console.exe' failed with exit code 1
##[warning]No results found to publish.
##[error]VsTest task failed.
##[section]Finishing: Test Run `
With Latest version the same.
Run with /ListLogger option:
/ListLoggers
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.TrxLogger.TrxLogger
Uri: logger://Microsoft/TestPlatform/TrxLogger/v1
FriendlyName: Trx
##[warning]No results found to publish.
##[section]Finishing: Test Run
This is my pipeline config steps
When you build your project, do you see ReportPortal.VsTest.TestLogger.dll
file in output directory (bin/debug)? And ReportPortal.config.json
file?
Yes, it is in bin folder but name of the folder is not debug i'm using different name of configuration (local and remote).
Does it work locally?
Let's try to execute tests on VSTS with /Diag:MyLog.txt
. Then let's see logs.
What is your .net target framework?
.NET Framework 4.6.1
Could you please upgrade package to ReportPortal.VSTest.TestLogger 2.0.0-beta.4 and execute vsts job again?
Build finished with no errors. Trying to get results into reportportal, looks like with json something wrong, but currently cannot figure out. Thank you for help, you are doing really great job!
Ensure in console output you have something like "Results are sent to ReportPortal".
Find your results on "Debug" tab in RP.
Can be configured in json file - debug
property.
Such error found in log:
Error:
TpTrace Error: 0 : 7324, 3, 2019/03/15, 14:06:40.942, 14052382115029, vstest.console.exe, InternalTestLoggerEvents.SendTestResult: Exception occurred while calling handler of type ReportPortal.VSTest.TestLogger.ReportPortalLogger for TestResultEventArgs: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at ReportPortal.VSTest.TestLogger.ReportPortalLogger.Events_TestResult(Object sender, TestResultEventArgs e)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at Microsoft.VisualStudio.TestPlatform.Utilities.MulticastDelegateUtilities.SafeInvoke(Delegate delegates, Object sender, EventArgs args, String traceDisplayName)
TpTrace Error: 0 : 7324, 3, 2019/03/15, 14:06:40.942, 14052382148185, vstest.console.exe, InternalTestLoggerEvents.SendTestResult: Exception occurred while calling handler of type ReportPortal.VSTest.TestLogger.ReportPortalLogger for TestResultEventArgs: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at ReportPortal.VSTest.TestLogger.ReportPortalLogger.Events_TestResult(Object sender, TestResultEventArgs e)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at Microsoft.VisualStudio.TestPlatform.Utilities.MulticastDelegateUtilities.SafeInvoke(Delegate delegates, Object sender, EventArgs args, String traceDisplayName)
Error:
TpTrace Error: 0 : 7324, 3, 2019/03/15, 14:06:48.606, 14052458866824, vstest.console.exe, InternalTestLoggerEvents.SendTestRunComplete:
Exception occurred while calling handler of type ReportPortal.VSTest.TestLogger.ReportPortalLogger for TestRunCompleteEventArgs:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: The tasks argument included a null value.
Parameter name: tasks
at System.Threading.Tasks.TaskFactory.CheckMultiContinuationTasksAndCopy(Task[] tasks)
at System.Threading.Tasks.TaskFactory
1.ContinueWhenAllImpl(Task[] tasks, Func2 continuationFunction, Action
1 continuationAction, TaskContinuationOptions continuationOptions, CancellationToken cancellationToken, TaskScheduler scheduler, StackCrawlMark& stackMark)
at System.Threading.Tasks.TaskFactory.ContinueWhenAll[TResult](Task[] tasks, Func2 continuationFunction)
at ReportPortal.Shared.Reporter.TestReporter.Finish(FinishTestItemRequest request)
at ReportPortal.VSTest.TestLogger.ReportPortalLogger.Events_TestRunComplete(Object sender, TestRunCompleteEventArgs e)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at Microsoft.VisualStudio.TestPlatform.Utilities.MulticastDelegateUtilities.SafeInvoke(Delegate delegates, Object sender, EventArgs args, String traceDisplayName)
My json:
{
"$schema": "https://raw.githubusercontent.com/reportportal/agent-net-vstest/master/ReportPortal.VSTest.TestLogger/ReportPortal.config.schema",
"enabled": true,
"server": {
"url": "http://myhost:8080/api/v1/",
"project": "superadmin_personal",
"authentication": {
"uuid": "74c2b0f9-90f4-474f-bcaf-52fb48249ce6"
}
},
"launch": {
"name": "superadmin_TEST_EXAMPLE",
"description": "this is description",
"debugMode": true,
"tags": ["t1", "t2"]
}
}
I guess the initial issue can be considered as resolved in v2.0.0. Please create another issue for problem above.
working only on 15.9.0 vstest version, on 15.9.1 and latest version i have same error.
Fixed in #18
Hi,
I'm using simple .net framework application with automatic tests and CI tool VSTS, im trying to run tests with following command as Other console options:
/TestAdapterPath:. /Logger:ReportPortal
And next error appears:I found instructions for dotnet core application how to fix this using dotnet publish, but nothing was said about .net framework
Any suggestion how to fix this?