Open ghost opened 5 years ago
Actually .netcore is possible only with vstest runner and NUnit3TestAdapter nuget package. Reporting results to RP will be possible when new version of NUnit3TestAdapter package will be released (v3.14.0). It is not officially released yet, we are in awaiting of this version.
You can ask here what is planned date of release. Last time when I asked was end of April, might be they forgot to release it, not sure.
@nvborisenko, Thanks for your answer, but I'm trying to run my .net core tests via vstest runner and get next error:
[7/5/2019 11:49:01 AM Error] Microsoft.VisualStudio.TestPlatform.Common.Exceptions.InvalidLoggerException: Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'ReportPortal'. at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.TestLoggerManager.Initialize(String runSettings) at Microsoft.VisualStudio.TestPlatform.Client.TestPlatform.CreateTestRunRequest(IRequestData requestData, TestRunCriteria testRunCriteria, TestPlatformOptions options) at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.RunTests(IRequestData requestData, TestRunCriteria testRunCriteria, ITestRunEventsRegistrar testRunEventsRegistrar, TestPlatformOptions options) at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.RunTests(TestRunRequestPayload testRunRequestPayload, ITestHostLauncher testHostLauncher, ITestRunEventsRegistrar testRunEventsRegistrar, ProtocolConfig protocolConfig) at Microsoft.VisualStudio.TestPlatform.Client.DesignMode.DesignModeClient.<>c__DisplayClass18_0.<StartTestRun>b__0()
but if I'm using dotnet test, than all works fine.
P.S my *.runsettings file:
it looks like <TestAdaptersPaths>.</ TestAdaptersPaths>
doesn't connect needed adapter for ReportPortal. I assume that the studio does not run tests from the working directory of the project.
maybe you met this?
To do it, what you wanted, you need use https://github.com/reportportal/agent-net-vstest agent.
If you already use it please share the list of installed nuget packages and the version of Visual Studio. It works for me with v16.1.1. Not sure, this magic is supported beginning v15.9.
@nvborisenko
Please share your config file. I reproduced your issue if url
parameter is incorrect.
@nvborisenko
Does dotnet test -l:ReportPortal
work properly?
@nvborisenko Yes, it works with dotnet test -l:ReportPortal
, but I'm trying to run tests from visual studio with Report portal integration.
@OlegYanushkevich please review my Visual Studio settings:
If you have the same settings - I have no idea what is wrong.
@nvborisenko same settings for my Visual Studio:) I do not know what could be the reason. Thanks for your help.
Try to change logging level to diagnostical on the screenshot above. Might we see better error message.
@OlegYanushkevich one more idea: verify that you don't have specified environment variables starting with REPORTPORTAL_
.
I think I had to install ReportPortal.Shared as I was getting same error, although I was not using nUnit
@suszi88 , @OlegYanushkevich, @nvborisenko Hi Guys. Wanted to ask ) In the end you solved the problem? Because Looks like i have the same issue now.
[03/03/2020 14:13:02 Diagnostic] RunSettings Content:
[03/03/2020 14:13:02 Diagnostic] Value of UseSpecifiedAdapterLocations as specified in Tools -> Options: True [03/03/2020 14:13:02 Diagnostic] Test framework could not be determined for project: C:\Users\antonm\Source\Repos\UnitTestProject1\UnitTestProject1\bin\Debug\netcoreapp2.1\UnitTestProject1.dll because reference path is null for at least one reference: Microsoft.NETCore.App [03/03/2020 14:13:02 Diagnostic] Value of FallbackToGlobalVsix as specified in Tools -> Options: True [03/03/2020 14:13:02 Diagnostic] Adapter location settings being used after evaluation: UseSpecifiedAdapterLocations = False, SkipDefaultAdapters = False, AreAllTestContainersCSharpOrVBProjectsOnly = True [03/03/2020 14:13:04 Diagnostic] Discovering tests in C:\Users\antonm\Source\Repos\UnitTestProject1\UnitTestProject1\ReportPortal.cs [03/03/2020 14:13:04 Diagnostic] RockSteady initialized with the following extensions: C:\Users\antonm.nuget\packages\mstest.testadapter\1.3.2\build_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
[03/03/2020 14:13:05 Diagnostic] Final RunSettings for the current TestRunCriteria:
[03/03/2020 14:13:08 Error] Microsoft.VisualStudio.TestPlatform.Common.Exceptions.InvalidLoggerException: Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'ReportPortal'.
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.TestLoggerManager.Initialize(String runSettings)
at Microsoft.VisualStudio.TestPlatform.Client.TestPlatform.CreateTestRunRequest(IRequestData requestData, TestRunCriteria testRunCriteria, TestPlatformOptions options)
at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.RunTests(IRequestData requestData, TestRunCriteria testRunCriteria, ITestRunEventsRegistrar testRunEventsRegistrar, TestPlatformOptions options)
at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.RunTests(TestRunRequestPayload testRunRequestPayload, ITestHostLauncher testHostLauncher, ITestRunEventsRegistrar testRunEventsRegistrar, ProtocolConfig protocolConfig)
at Microsoft.VisualStudio.TestPlatform.Client.DesignMode.DesignModeClient.<>c__DisplayClass19_0.
@antonmalch I installed the ReportPortal.Shared nuget and it solved the issue. I see that you do not have it
ReportPortal.Shared
package is installed automatically, it's ok that you don't see it in the list of installed packages.
@antonmalch could you please share your test solution and how you execute tests?
@nvborisenko It's new Project (for testing Report Portal)
@antonmalch just for the record, for me running from vs is not working, it will only integrate with report portal while running from cmd, but it's my case, hope you will solve your issue
Hi, @suszi88 , ok, understood, thank you
Visual Studio 2017?
Hi, yes
@antonmalch do you have any ReportPortal.*.log
files in the directory where sln
or csproj
file is located, or near with tests assembly?
@nvborisenko Good morning. Looks like no. I have not ReportPortal.*.log
Hey @antonmalch @suszi88 @OlegYanushkevich I was able to reproduce this issue and found out what was a problem.
Please try to use v3.0.0-beta.2
version of the package. I suggest to restart VS after upgrading to let VS reload Logger.
Note: this package is only for the latest ReportPortalv5.
@antonmalch you will get errors, but it will be separate issue (incorrect url parameter in config). Please share your ReportPortal.*.log
files near with sln
.
Guys, please report back whether it fixes the issue.
Hi,
v3.0.0-beta.2 version of the package - done
But I can't find ReportPortal.*.log files. This file(s) should installed automatically?
Will be appeared after tests execution.
@nvborisenko , I have execute test (from VS) few times and nothing. Still can't find ReportPortal.*.log files.
[04/03/2020 15:21:14 Diagnostic] About to Enqueue operation 'RunFromContextOperation', hashcode:51164618 [04/03/2020 15:21:14 Diagnostic] Enqueue operation 'RunFromContextOperation', hashcode:51164618 [04/03/2020 15:21:14 Diagnostic] Operation left in the the queue: 1 [04/03/2020 15:21:14 Diagnostic] 'RunFromContextOperation', hashcode:51164618 [04/03/2020 15:21:14 Diagnostic]
[04/03/2020 15:21:14 Diagnostic] Processing Queue .....
[04/03/2020 15:21:14 Diagnostic] Operation Dequeue : 'RunFromContextOperation'
[04/03/2020 15:21:14 Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=OperationSetStarted, operationInProgress=False
[04/03/2020 15:21:14 Diagnostic] TestDiscoveryStats.OperationStateChanged State=OperationSetStarted, InProgress=False
[04/03/2020 15:21:14 Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=ChangeDetectionStarting, operationInProgress=True
[04/03/2020 15:21:14 Diagnostic] TestDiscoveryStats.OperationStateChanged State=ChangeDetectionStarting, InProgress=False
[04/03/2020 15:21:14 Diagnostic] We programmatically start the build in TestWindowHost.UpdateContainer...
[04/03/2020 15:21:14 Diagnostic] Adding the Project in Project Map for Guid 0d4c4dfd-517d-47b6-953e-15a0869c4686
[04/03/2020 15:21:14 Diagnostic] Time taken for fetching Roslyn supported projects: 0 milliseconds.
[04/03/2020 15:21:14 Diagnostic] After we await the build that programmatically started in TestWindowHost.UpdateContainer...
[04/03/2020 15:21:14 Diagnostic] Adding the Project in Project Map for Guid 0d4c4dfd-517d-47b6-953e-15a0869c4686
[04/03/2020 15:21:14 Diagnostic] TestContainer update (build) complete : 387 ms
[04/03/2020 15:21:14 Diagnostic] Adding the Project in Project Map for Guid 0d4c4dfd-517d-47b6-953e-15a0869c4686
[04/03/2020 15:21:14 Diagnostic] Adding the Project in Project Map for Guid 0d4c4dfd-517d-47b6-953e-15a0869c4686
[04/03/2020 15:21:14 Diagnostic] Test framework could not be determined for project: C:\Users\antonm\Source\Repos\UnitTestProject1\UnitTestProject1\bin\Debug\netcoreapp2.1\UnitTestProject1.dll because reference path is null for at least one reference: Microsoft.NETCore.App
[04/03/2020 15:21:14 Diagnostic] DiscoveryOperation
[04/03/2020 15:21:14 Diagnostic] Value of UseSpecifiedAdapterLocations as specified in Tools -> Options: True [04/03/2020 15:21:14 Diagnostic] Value of FallbackToGlobalVsix as specified in Tools -> Options: True [04/03/2020 15:21:14 Diagnostic] Adapter location settings being used after evaluation: UseSpecifiedAdapterLocations = False, SkipDefaultAdapters = False, AreAllTestContainersCSharpOrVBProjectsOnly = True [04/03/2020 15:21:15 Diagnostic] Final RunSettings for the current TestRunCriteria:
[04/03/2020 15:21:16 Diagnostic] Discovering tests in C:\Users\antonm\Source\Repos\UnitTestProject1\UnitTestProject1\ReportPortal.cs
[04/03/2020 15:21:16 Diagnostic] VirtualReadOnlyTestDataStore.OperationStateChanged State=OperationSetFinished, operationInProgress=False
[04/03/2020 15:21:16 Diagnostic] TestDiscoveryStats.OperationStateChanged State=OperationSetFinished, InProgress=False
[04/03/2020 15:21:16 Error] Microsoft.VisualStudio.TestPlatform.Common.Exceptions.InvalidLoggerException: Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'ReportPortal'.
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.TestLoggerManager.Initialize(String runSettings)
at Microsoft.VisualStudio.TestPlatform.Client.TestPlatform.CreateTestRunRequest(IRequestData requestData, TestRunCriteria testRunCriteria, TestPlatformOptions options)
at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.RunTests(IRequestData requestData, TestRunCriteria testRunCriteria, ITestRunEventsRegistrar testRunEventsRegistrar, TestPlatformOptions options)
at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.RunTests(TestRunRequestPayload testRunRequestPayload, ITestHostLauncher testHostLauncher, ITestRunEventsRegistrar testRunEventsRegistrar, ProtocolConfig protocolConfig)
at Microsoft.VisualStudio.TestPlatform.Client.DesignMode.DesignModeClient.<>c__DisplayClass19_0.
@antonmalch And have you restarted Visual Studio?
@nvborisenko Yes
I also see issues on clean environment with VS2017 and .netcore2.1, sometimes I saw different issues, It depends on @DzmitryHumianiuk how much we want to invest to resolve the issue.
@nvborisenko it's hard for to evaluate something in .net world. So i should rely on you here.
@nvborisenko @antonmalch have you got solution to the problem? I am also getting the same error with latest v3.0.0-beta.3.Please help
@jsingh-qualitrol VS 2017?
No i am using VS 2019
yes i followed the same steps mentioned in the link. @nvborisenko
https://github.com/reportportal/example-net-vstest please play with this pre-configured project.
@jsingh-qualitrol please share a project you have played with.
Reproduced it again on my side. Working solution is specifying full path to output folder (bin\Debug) in runsettings file, TestAdaptersPaths property.
Update: first time you have to provide full path, then it works without providing full path, I'm using VS2019
And finally the root cause of the issue is relative path specified in runsettings
file. Official way is to use .
(current directory) as a location where VS (or any other test runner) should search for test adapter (test logger). Since this is relative path, the question is relative to what.
When we execute tests in Visual Studio, then my finding is relative path to Visual Studio directory where VS was run from.
If I start VS from Windows task bar, the current directory is C:\\Program Files\\...
. And, VS runner cannot find test logger. But if I open solution file in File Explorer (double click on *.sln
) then current directory for VS is the directory where *.sln
file is located. In this case VS is able to find test logger in project's bin/Debug
directory.
Thus, for all who is experiencing this issue, please open your solution file using double click in File Explorer.
This issue cannot be considered as resolved, let's see what MS swill say.
Hi, I want to migrate my tests from .net framework to .net core and I do not understand how to integrate the report portal with my tests. I read readme file and there it is somehow incomprehensibly described flow for .net core. Could you explain me it possible, and if yes, then how we can do it. Thanks!