-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get codebase tests working with ReSharper and Rider #3008
Comments
@jnm2 - Interestingly... this seems to be working since I upgraded to point to the latest NUnitVSTestAdapter (v3.10.0) I don't have Rider to test that but I'm able to select a framework and debug in R#. |
Good! I tried in Rider 2018.2.3:
|
ReSharper uses its own way of detecting NUnit tests. Might that be the issue? |
Not sure if this is meant to be raised as a separate issue, but my team recently discovered we can't run tests via ReSharper too (obviously not NUnit codebase ones). Running a test after rebuilding the solution works, but every other attempt afterwards fails in ReSharper with test being marked as inconclusive. Looking at the error output, it seemed that ReSharper is trying to find the tests .dll in its own directory rather than the default one (bin\Debug). We tried the suggestion by @DaiMichael but that didn't solve it. It turned out to be an issue with NUnit 3.11.0. We're currently using NUnit 3.10.1 which works fine with ReSharper. |
@asendimitrov Last I heard, ReSharper relies on the VSTest adapter. Do you have the latest NUnit3TestAdapter package referenced in your test csproj? If not, would you please open a new issue with a repro? I know that ReSharper works with NUnit 3.11.0 in many projects, so something unique is happening with your project. |
Hi @jnm2 , thanks for you response. I don't think we've ever needed to use NUnit3TestAdapter in any of our solutions. We have solutions using SpecFlow (which might be one reason) but we also have ones which use pure NUnit tests and they run fine without NUnit3TestAdapter. Nevertheless, I've added the latest NUnit3TestAdapter (v 3.10.0) in a solution using SpecFlow and a solution not using it, both of these have NUnit 3.11.0 installed. Both have the same issue marking tests as inconclusive on every run after the first. I don't think NUnit3TestAdapter affects R# in any way unfortunately. If you have other suggestions, I'm happy to keep digging (kinda want to make sure it's on my end before opening a separate issue). P.S. The R# error message I mentioned in my previous post is the following: |
Without seeing the repro projects, no ideas come to mind except that you might have a VSIX NUnit adapter overriding the project-level adapter? |
Nope, I don't have anything installed. I just tried with a brand new solution:
This is my packages.config:
After the 1st run, the test is marked as inconclusive with the error i mentioned above. VS version: 15.8.7 |
And if you install NUnit3TestAdapter in your packages.config (current version 3.10.0), ReSharper doesn't start working? (They've told us they use this test adapter.) |
As far as I can tell Reshaper/Rider bundles the runners and do not make usage of the adapter From https://www.jetbrains.com/help/rider/Reference__Options__Tools__Unit_Testing__NUnit.html
and
@asendimitrov What if you set "Custom NUnit Installation" in the Resharper NUnit settings to your installation of the console does that change anything? (the reference notes that for this "JetBrains Rider 2018.2 supports NUnit 3.10.1 and above.") |
Sorry @jnm2 , I should've really shared that as a result in the first place... But yes installing Nunit3TestAdapter doesn't do anything to help in this case:
@mikkelbu That didn't help either, although I think that even if it did it wouldn't be a solution to the issue as this is about ReSharper running the tests without needing anything additional (as it it does with NUnit 3.10.1) |
@mikkelbu Ah, looks like they only use our adapter for .NET Core tests: nunit/nunit3-vs-adapter#487 (comment), nunit/nunit3-vs-adapter#487 (comment). Thanks! |
@asendimitrov I'm using VS 15.8.7 and ReSharper 2018.2.3. I think I followed your steps exactly and I got this: Here's the entire project I created: NunitGitRepro.zip Does it fail for you? If so, I'd try updating ReSharper or go to JetBrains for support since I can't think of anything else. If not, can you make it fail and send it back? |
@asendimitrov @jnm2 I also tried to repoduce the problem, and I was successful VS 15.8.5 and ReSharper 2017.3.5. I tried to look into the errors and warnings and also got "Cannot run tests: File not found" in the resharper GUI. From https://resharper-support.jetbrains.com/hc/en-us/community/posts/360000436150-PipeException-The-pipe-endpoint-net-pipe-machine-TestExecutor-port-could-not-be-found-on-your-local-machine-while-debugging-mstest-projectI got the inspiration to run I also tried some of the suggestions mentioned in the thread, but that did not solve the problem. I'll see if I have time to look more into it tonight (and e.g. try out the NunitGitRepro.zip) Additional links: |
@jnm2 I'm getting the same issue with your project. Here's mine if you wanna give it a try: Only difference is the existence of NUnit3TestAdapter as you advised. @mikkelbu I've done some research on the jetbrains site as well, seems like there may be different reasons to why ReSharper behaves like that. By raising this here I just wanted to make sure it's not an NUnit issue itself that causes this, as the older framework version actually works fine which was a smell to me. Thanks both for looking into this! |
@NikolayPianikov can you help with this issue or know someone who can? |
@rprouse I asked for comments |
Although nearly 2 years later, I'm still getting this same issue. VS2019 with .Net 5 installed. Right click on the AssertEqualsTests class --> "Run Unit Tests". Result: However, open windows terminal and navigate to "bin\Debug\net5.0". |
Somewhere along the line we stopped being able to run tests on ReSharper. Test Explorer is the only way to run IDE tests right now. Rider is another IDE I want to get working.
The text was updated successfully, but these errors were encountered: