nunit3-vs-adapter: Test discovery fails when using TestCaseSource in RIDER and VS2017 with Resharper Unit Tests
Hi, Since updating NUnit3TestAdapter to version 3.16.0 the test discovery fails when projects are using the TestCaseSource.
Versions:
- NUnit: 3.12.0
- NUnit3TestAdapter: 3.16.0
- VS2017: 15.9.18
- Resharper: 2019.3.1
- Rider: 2019.3.1
- .Core Version: 2.2.110
- Target Framework: netcoreapp2.2
Test project to reproduce the error: https://github.com/nesc58/nunit-test-project
Is this a bug in NUnit3TestAdapter or is there something wrong in Resharper 2019.3.1?
After downgrading the project to version 3.15.1 everything works fine.
On command line using dotnet test everything works fine.
kind regards, nesc
Test discovery exception:
Unfortunately, it's impossible to discover unit tests in some of your projects. :(
Below you can find the error details for each project.
Exception:
Exception occured during exploration.
System.ArgumentException: Cannot parse testId Tests.Tests.Test1 with displayName Test1(1, 1, 2)
bei JetBrains.ReSharper.UnitTestProvider.nUnit.v30.DotNetCore.NUnitDotNetCoreTestElementMapper.ParseFqn(Test test)
bei JetBrains.ReSharper.UnitTestProvider.nUnit.v30.DotNetCore.NUnitDotNetCoreTestElementMapper.Map(Test test, Boolean isDiscovery, Boolean& wasChanged)
bei JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestDiscovery.CreateElements(TestCase testCase)
bei JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestDiscovery.TestsDiscovered(TestCase[] tests)
bei Appccelerate.StateMachine.Machine.ActionHolders.ArgumentActionHolder`1.Execute(Object argument) in C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\ActionHolders\ArgumentActionHolder.cs:Zeile 50.
bei Appccelerate.StateMachine.Machine.Transitions.Transition`2.PerformActions(ITransitionContext`2 context) in C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\Transitions\Transition.cs:Zeile 225.```
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 9
- Comments: 16 (7 by maintainers)
Jetbrains says the fix will be in 2020.1 and 2019.3.2
I have created an issue at the jetbrains support system, https://youtrack.jetbrains.com/issue/RSRP-477651
The issue seems to come from a mismatch between how the FullyQualifiedName is being defined in the 3.16 version compared to what Resharper UnitTestProvider expects. That changed between 3.15.1 and 3.16. The way it is in 3.15.1 is a bug, which was fixed by PR 668 (information about the fix is in the PR), and actually fixed a whole series of bugs in the adapter. The error can be seen in the stack trace above where it says DisplayName doesnt match FQN. See 668 for an explanation, and also code changes at https://github.com/nunit/nunit3-vs-adapter/commit/78300b4d6201448e2b92a3920fc060c0e5887d39#diff-b7a39ec0f3d5eb92159134f889fdddb3 .
I’ll contact Jetbrains about this issue.
Thank you. With the 3.16.1 release the issue is fixed for me. All tests were correctly discovered. https://github.com/nunit/nunit3-vs-adapter/releases/tag/V3.16.1
Having exactly the same issue, have reverted back to NUnit3TestAdapter 3.15.1