nunit / dotnet-test-nunit

Deprecated test runner for .NET Core. For use with project.json only. For recent releases of .NET Core, use the NUnit 3 Visual Studio Adapter
https://www.nuget.org/packages/dotnet-test-nunit/
MIT License
67 stars 25 forks source link

Cannot run NUnit with ReSharper #106

Open tpluscode opened 7 years ago

tpluscode commented 7 years ago

Sorry if this is not the right place to ask. I'm converting a project to project.json and dotnet test works fine in console. I updated to R# 2016.3.2 and my tests are discovered in VS. Unfortunately I cannot run them. When I try, no tests are executed and the Unit Test Session window displays an exception stack trace:

ERROR System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at JetBrains.ReSharper.UnitTestFramework.Launch.Stages.DiscoveryStage.Run(CancellationToken token)
   at JetBrains.ReSharper.UnitTestFramework.Launch.UnitTestLaunch.RunStage(Object stageObject)
---> (Inner Exception #0) System.Threading.Tasks.TaskCanceledException: A task was canceled.<---

My project.json is as follows (relevant parts):

{
 "dependencies": {
    "NUnit": "3.6.1",
    "dotnet-test-nunit": "3.4.0-*"
  },
  "testRunner": "nunit"
}

Is there anything I can try?

jnm2 commented 7 years ago

This might be https://youtrack.jetbrains.com/issue/RSRP-461908

jnm2 commented 7 years ago

Wait- you're converting to project.json, not from project.json?

If you're converting a .NET Framework (not .NET Core) .csproj from packages.config (NuGet v2) to project.json (NuGet v3), 2017.1 EAP 2 is the first version of ReSharper that has worked for me for months.

tpluscode commented 7 years ago

Unfortunately EAP 3 doesn't work either :(. Same error.

jnm2 commented 7 years ago

Your project.json looks like you're running .NET Core. Is that correct? Be aware that project.json's official replacement is being released on the 7th with VS2017's RTM, a new .csproj format for both .NET Core and .NET Framework where no project.json file is used.