Can't debug NUnit tests in Rider

Hi,

 

I've created a new Console application in rider with .net Core 3.1 and then created a new Test project which came with NUnit.

And for some reasons, I can run the tests but I can't debug them. It either hang on "Pending" or end in "Inconclusive: Test not run".

Test project csproj:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\FunctionDefinitionParser\FunctionDefinitionParser.csproj" />
</ItemGroup>

</Project>

#Test class:
namespace FunctionDefinitionParser.Tests
{
public class Tests
{
[SetUp]
public void Setup()
{
}

[Test]
public void Test_Debug()
{
var prout = 3;
Assert.AreEqual(3, prout);
}
}
}

Content of the logs:

17:08:31.983 |T| Launch: 821c743f-22bb-47b9-8792-f8b1bd005da0 >> RiderDebugHostController.AfterLaunchStarted
17:08:31.988 |T| Launch: 821c743f-22bb-47b9-8792-f8b1bd005da0 << RiderDebugHostController.AfterLaunchStarted
17:08:32.001 |I| BuildStage started
17:08:32.001 |I| Build policy: Automatic
17:08:33.405 |I| 0 projects built
17:08:33.406 |I| BuildStage completed
17:08:33.406 |I| RefreshProjectPropertiesStage started
17:08:33.406 |I| RefreshProjectPropertiesStage completed
17:08:33.406 |I| DiscoveryStage started
17:08:33.407 |I| Test exploration required for 0 projects
17:08:33.407 |I| DiscoveryStage completed
17:08:33.407 |I| BuildPipelineStage started
17:08:33.407 |I| BuildPipelineStage completed
17:08:33.407 |I| ApplyRulesStage started
17:08:33.408 |V| Running elements from criterion: {TestAncestorCriterion: NUnit3x::FBB0EAB7-5E72-45A9-9009-1853F2BA1FB4::.NETCoreApp,Version=v3.1::FunctionDefinitionParser.Tests.Tests.Test_Debug}
17:08:33.408 |I| Got 1 elements (1 explicit) to run
17:08:33.408 |V| Marking 1 elements as Pending
17:08:33.409 |V| Marking elements as Pending completed
17:08:33.409 |V| Distributing 1 elements into runs
17:08:33.410 |V| Distributing elements completed
17:08:33.410 |I| Created 1 unit-test runs
17:08:33.410 |I| ApplyRulesStage completed
17:08:33.410 |I| RunTestsStage started
17:08:33.411 |I| Running up to 1 unit-test runs in parallel
17:08:33.411 |I| Run: 5a1d0def-5a1f-4542-986a-dc9518074d2c - Starting
17:08:33.411 |V| Provider: NUnit 3x
Target Framework: .NETCoreApp,Version=v3.1
Strategy: NUnitDotNetVsTestRunStrategy
Runtime Enviroment: DotNetCoreRuntimeEnvironment
Project: FunctionDefinitionParser.Tests
TargetFrameworkId: .NETCoreApp,Version=v3.1
TargetPlatform: X64
17:08:33.412 |T| Run: 5a1d0def-5a1f-4542-986a-dc9518074d2c >> RiderDebugHostController.PrepareForRun
17:08:33.412 |T| Run: 5a1d0def-5a1f-4542-986a-dc9518074d2c << RiderDebugHostController.PrepareForRun
17:08:33.412 |T| Register handler for message type 'TestSession.Message', protocol version '1'
17:08:33.412 |T| Register handler for message type 'ProtocolVersion', protocol version '<unset>'
17:08:33.412 |T| Register handler for message type 'TestSession.Connected', protocol version '<unset>'
17:08:33.412 |T| Register handler for message type 'TestExecution.CustomTestHostLaunch', protocol version '1'
17:08:33.413 |T| Register handler for message type 'TestExecution.Completed', protocol version '1'
17:08:33.413 |T| Register handler for message type 'TestExecution.StatsChange', protocol version '1'
17:08:33.416 |I| [ProcessStartInfoPatchResult]
Original request: DotNetCoreRequest
Success: True
ErrorMessage: <Empty>
Original StartInfo: FileName = 'vstest', Arguments = '/port:59560 ', WorkDir = 'C:\Users\503112802\Documents\BATranspiler\FunctionDefinitionParser.Tests'
Patched StartInfo: FileName = 'C:\Program Files\dotnet\dotnet.exe', Arguments = '"vstest" /port:59560 ', WorkDir = 'C:\Users\503112802\Documents\BATranspiler\FunctionDefinitionParser.Tests'

17:08:33.417 |I| Starting process: C:\Program Files\dotnet\dotnet.exe "vstest" /port:59560
17:08:33.431 |I| Started process with pid 9636
17:08:34.815 |T| Processing message 'TestSession.Connected'
17:08:34.815 |T| Processed message 'TestSession.Connected'
17:08:34.822 |T| Processing message 'ProtocolVersion'
17:08:34.822 |T| Processed message 'ProtocolVersion'
17:08:34.822 |I| Using test adapter: C:\Users\503112802\Documents\BATranspiler\FunctionDefinitionParser.Tests\bin\Debug\netcoreapp3.1\NUnit3.TestAdapter.dll
17:08:34.823 |T| RunSettings:
<?xml version='1.0' encoding='utf-8'?>
<RunSettings>
<RunConfiguration>
<TargetFrameworkVersion>.NETCoreApp,Version=v3.1</TargetFrameworkVersion>
<TargetPlatform>X64</TargetPlatform>
</RunConfiguration>
</RunSettings>
17:08:35.802 |T| Processing message 'TestSession.Message'
17:08:35.802 |T| Processed message 'TestSession.Message'
17:08:35.802 |I| NUnit Adapter 3.17.0.0: Test execution started
17:08:35.843 |T| Processing message 'TestSession.Message'
17:08:35.843 |T| Processed message 'TestSession.Message'
17:08:35.843 |I| Running selected tests in C:\Users\503112802\Documents\BATranspiler\FunctionDefinitionParser.Tests\bin\Debug\netcoreapp3.1\FunctionDefinitionParser.Tests.dll
17:08:36.050 |T| Processing message 'TestSession.Message'
17:08:36.050 |T| Processed message 'TestSession.Message'
17:08:36.050 |I| NUnit3TestExecutor discovered 1 of 1 NUnit test cases
17:08:36.132 |T| Processing message 'TestSession.Message'
17:08:36.132 |T| Processed message 'TestSession.Message'
17:08:36.132 |I| NUnit Adapter 3.17.0.0: Test execution complete
17:08:36.288 |T| Processing message 'TestExecution.StatsChange'
17:08:36.288 |T| Processed message 'TestExecution.StatsChange'
17:08:36.290 |W| Transition declined: Transition from state <v1.HostBinding> on event <remote::1.TestExecution.StatsChange>.
17:08:36.300 |T| Processing message 'TestExecution.Completed'
17:08:36.300 |T| Processed message 'TestExecution.Completed'
17:08:36.356 |I| Process C:\Program Files\dotnet\dotnet.exe:9636 has exited with code (0)
17:08:36.357 |I| Output stream: Microsoft (R) Test Execution Command Line Tool Version 16.7.0
Copyright (c) Microsoft Corporation. All rights reserved.



17:08:36.357 |T| Run: 5a1d0def-5a1f-4542-986a-dc9518074d2c >> RiderDebugHostController.CleanupAfterRun
17:08:36.357 |T| Run: 5a1d0def-5a1f-4542-986a-dc9518074d2c << RiderDebugHostController.CleanupAfterRun
17:08:36.357 |I| Run: 5a1d0def-5a1f-4542-986a-dc9518074d2c - Finished
17:08:36.357 |I| RunTestsStage completed
17:08:36.357 |I| FinishLaunchStage started
17:08:36.357 |I| Finishing launch
17:08:36.358 |W| Element FunctionDefinitionParser.Tests.Tests.Test_Debug was left pending after its run completion.
17:08:36.358 |I| Launch is finished
17:08:36.358 |I| FinishLaunchStage completed
17:08:36.358 |T| Launch: 821c743f-22bb-47b9-8792-f8b1bd005da0 >> RiderDebugHostController.BeforeLaunchFinished
17:08:36.358 |T| Launch: 821c743f-22bb-47b9-8792-f8b1bd005da0 << RiderDebugHostController.BeforeLaunchFinished

Seems like the dotnet process exits with an error but does not provide any relevant information...

Did anyone had to fight with this also ?

 

Thanks

5 comments
Comment actions Permalink

Hi Maxime FAYE, could you specify the Rider version you are using?

0
Comment actions Permalink

Hi,

I think that I have the latest version :

JetBrains Rider 2020.1.4
Build #RD-201.8538.1, built on July 3, 2020
Licensed to Maxime Faye
Subscription is active until September 20, 2020
Runtime version: 11.0.7+10-b765.64 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
.NET Framework 4.0.30319.42000
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1466M
Cores: 4
Registry: debugger.new.debug.tool.window.view=true, ide.tree.horizontal.default.autoscrolling=false, performance.watcher.sampling.interval.ms=200, ide.tooltip.showAllSeverities=true, show.diff.preview.as.editor.tab=true, ide.borderless.title.product=false, ide.title.debug=true, light.edit.file.open.enabled=false, performance.watcher.unresponsive.interval.ms=1000, ide.tooltip.initialDelay.highlighter=0, search.everywhere.settings=true, show.diff.preview.as.editor.tab.with.single.click=true, parameter.info.max.visible.rows=10, ide.win.file.chooser.native=true, vcs.log.show.diff.preview.as.editor.tab=true, ide.borderless.title.debug=true, ide.borderless.title.project.path=false, search.everywhere.pattern.checking=false, ide.tooltip.initialDelay=0, ide.borderless.title.classpath=false, ide.require.transaction.for.model.changes=false
Non-Bundled Plugins: Batch Scripts Support, CMD Support, com.microsoft.vso.idea, PlantUML integration, org.intellij.plugins.markdown, com.intellij.ideolog, net.seesharpsoft.intellij.plugins.csv
0
Comment actions Permalink

Hi,

 

Thanks for the update.

 

You'll need to update to the latest Rider version 2020.2.1 - it supports new dotnet vstest behavior that was changed around version 3.1.400 of .NET Core SDK.

 

Let me know if the issue persists after the update.

 

 

 

0
Comment actions Permalink

Yop, did fix the issue. Thanks a lot.

0
Comment actions Permalink

Glad it helped! Feel free to contact us if you have any other questions.

0

Please sign in to leave a comment.