machine / machine.specifications

Machine.Specifications is a Context/Specification framework for .NET that removes language noise and simplifies tests.
MIT License
885 stars 178 forks source link

Rider/R# 2020.2 support #412

Closed dp0h closed 4 years ago

dp0h commented 4 years ago

Plugint is not working in the latest Rider/R# version.

robertcoltheart commented 4 years ago

This is being worked on, there are significant breaking changes, as JB have re-written all the unit test code. It may take a few days to get this out. I'd suggest rolling back your upgrades for now.

dp0h commented 4 years ago

Thanks for the update. I'll use previous version for a while.

iSchlicht commented 4 years ago

+1

robertcoltheart commented 4 years ago

Work is finished on this, I'm now testing and fixing bugs. Hoping to have a final release pushed out in the next 2-3 days.

robertcoltheart commented 4 years ago

The plugin update has been pushed to JetBrains plugins, it will take 2-3 business days for them to approve and for it to appear in the extension manager.

robertcoltheart commented 4 years ago

This update has been approved by Jetbrains and is now available in the extensions manager.

tpeplow commented 4 years ago

Just an FYI on this. I'm not sure of the root cause, I think it's because I don't run Rider elevated, but after I installed the plugin I was unable to run tests. It complained it couldn't find the test runner in this location C:\Program Files\JetBrains\JetBrains Rider 2020.1.4\lib\ReSharperHost\TestRunner\Adapters

To resolve it I found where the plugin was installed and there was the adapters I needed in there (which was %localappdata%\JetBrains\Rider2020.2\resharper-host\local\Shared\vAny\DeployedPackagesExpand\Machine.Specifications.Runner.Resharper9.2020.2.1~081F617F0B\TestRunner\Adapters

I copied the MSpec folder into C:\Program Files\JetBrains\JetBrains Rider 2020.1.4\lib\ReSharperHost\TestRunner\Adapters folder and the tests run.

Not sure where the bug is, I didn't check if my running elevated assumption, but if you get an error not being able to find Machine.Specifications.Runner.ReSharper.Adapters.net40 then this should do it.

robertcoltheart commented 4 years ago

Interesting, I'll debug further and see what the issue is.

robertcoltheart commented 4 years ago

Fix is here (I think): https://github.com/machine/machine.specifications.runner.resharper/pull/139

robertcoltheart commented 4 years ago

This has been released to JetBrains marketplace. Unfortunately it will take another 2 days for JB to approve it 🤷. If you want to side-step this, download the binaries and install them manually from here: https://github.com/machine/machine.specifications.runner.resharper/releases/tag/v2020.2.2

andhuman commented 4 years ago

I still have issues using the latest 2020.2.2.

Message = “
  TestRunner: Application  JetBrains.Rd.Tasks.RdFault: Could not load file or assembly 'file:///C:\Users\andhuman\AppData\Local\JetBrains\Rider2020.2\resharper-host\local\Shared\vAny\DeployedPackagesExpand\Machine.Specifications.Runner.Resharper9.2020.2.2~2DDA28307D\TestRunner\Adapters\MSpec\net40\Machine.Specifications.Runner.ReSharper.Adapters.Tasks.net40.dll' or one of its dependencies. The system cannot find the file specified., reason: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Users\andhuman\AppData\Local\JetBrains\Rider2020.2\resharper-host\local\Shared\vAny\DeployedPackagesExpand\Machine.Specifications.Runner.Resharper9.2020.2.2~2DDA28307D\TestRunner\Adapters\MSpec\net40\Machine.Specifications.Runner.ReSharper.Adapters.Tasks.net40.dll' or one of its dependencies. The system cannot find the file specified.
  File name: 'file:///C:\Users\andhuman\AppData\Local\JetBrains\Rider2020.2\resharper-host\local\Shared\vAny\DeployedPackagesExpand\Machine.Specifications.Runner.Resharper9.2020.2.2~2DDA28307D\TestRunner\Adapters\MSpec\net40\Machine.Specifications.Runner.ReSharper.Adapters.Tasks.net40.dll'

The file exist in the location so I don't know why it is complaining.

robertcoltheart commented 4 years ago

I can reproduce, I'll dive back in... 😓

robertcoltheart commented 4 years ago

sigh It seems as though it's a path that is longer than 260 characters, and Rider nests the file so deeply that it is overrunning this limit which exists in .NET versions prior to net462. Net Core seems to be unaffected. I'll get out a fix shortly.

robertcoltheart commented 4 years ago

Fixed here and released: https://github.com/machine/machine.specifications.runner.resharper/pull/142 It will take 2-3 days to be approved by JB.

If you want it earlier, please set up a Nuget feed here (for ReSharper): https://github.com/machine/machine.specifications.runner.resharper/packages

Or for Rider, download the ZIP and install manually here: https://github.com/machine/machine.specifications.runner.resharper/releases/tag/v2020.2.3