Runsettings ignored when using VS + NUnit + Resharper test runner
Hello!
I've recently updated Resharper to the latest version and runsettings selected via Visual Studio menu (Test > Configure Run Settings > Select Solution Wide runsettings File) stopped being injected when running NUnit tests with Resharper's test runner. In debug mode the runsettings dictionary (TestContext.Parameters) appears empty. Meanwhile VS's built-in test runner loads them normally.
Then I've also updated VS itself. Then I tried repairing everything and eventually completely reinstalling everything. Nothing helps, the problem seems Resharper-specific to me.
Versions:
- Visual Studio Professional 16.8.5
- Resharper 2020.3.2
- NUnit 3.12.0 + NUnit3TestAdapter 3.10.0
- Unit-test library target framework: .NET Framework 4.7.2
If any more info or logs needed, you're welcome.
Please sign in to leave a comment.
Well. It took me almost a whole day to figure out that Resharper has a separate configuration option for runsettings selection.
The option resides at Tools > Unit Testing > Test Runner:
I don't know what's the point in this option (but I guess there is some). And I don't know why in my case it seemingly has set itself to "use specific test settings file" (with the following path field being empty) after upgrading to 2020.3.2.
This was quite confusing. And yes, googling the topic with "Resharper runsettings" query was another inobvious mistake since the article I needed does not contain the "runsettings" word :)
https://www.jetbrains.com/help/resharper/Reference__Options__Tools__Unit_Testing__Test_Runner.html
And even more confusing stuff. The previous post's screenshot was taken after I've downgraded from 2020.3.2 to 2020.2. Then I've installed 2020.3.2 back, opened VS to check that the options are still there and... Wooow, only their section name remained in place:
Sooooo, after spending another several hours installing/removing/updating different Resharper versions in an attempt to understand what I've broken or which Resharper version between 2020.2 and 2020.3.2 has broken this, at last I understood that the options in this section only show up after you open the unit testing solution/project.
OMG. Configuration options. Which appear and disappear. Never seen something like this before...
Hello Stanislav,
Thank you for the input!
I have created a corresponding issue in regards to ".runsettings".
As for the disappearing Test Runner settings, I will check it as well and notify you right away.
Hello Stanislav,
I could not reproduce the issue in 2020.3.2, nor in 2020.3.3. Do you still experience the behaviour?
Could you clarify what kind of projects were in solution when the options disappeared?
Alexander Nikolaenko
It depends on which exactly issue you've been trying to reproduce :)
We have:
Currently using Resharper 2020.3.
Hi Stanislav,
Thank you for the details!
I have reproduced the issue with the blank Options area.
I have created a corresponding record on our bug tracker: RSRP-483928.
In the meantime, `.runconfig` is already changed to `.runsettings` and will be available in the next release.
Let me know if you have other questions. Have a good day!
Alexander Nikolaenko
FYI. I've just faced the "test settings" radio button changing from "use test settings selected in VS UI" to "use specific test settings file" by itself once again. And this time it seems like this happened after VS and VS Build Tools update via VS Installer.
Stanislav Bakharev
I checked the behaviour you reported and did not find it connected to VS either ReSharper update.
Perhaps, the setting was pulled from a "*.DotSettings" file in your case.
It seems that the problem persists in VS 2022 v17.6.5. The "Auto Detect runsettings file" option in the resharper configuration also does not work under the following conditions:
Only when I set the option “Use specific test settings file” to the specific path, it works (workaround). For us this state is a bit troublesome because by default the autodetection is running and the tests cannot be performed. We would be very happy if the autodetection of the .runsetting file would work without this workaround.
Hello M Keusch
This happens to be a known issue No runsettings file is used by R# test runner…, please follow it to get the latest updates on the fix.
Thank you.