How to enable Telerik JustMock Profiler ?
Answered
Hi, I use Telerik JustMock for my unit tests (MSTests style) and I try to run them in Rider (2020.3.4) but I receive this error :
The profiler must be enabled to mock, arrange or execute the specified target.
In Telerik forum, I find this post : https://www.telerik.com/forums/rider-profiler-support
Who said : If JetBrains Rider allows configuration before running the test you could enable the profiler and run the tests.
Is it possible in Rider ?
Please sign in to leave a comment.
Hello Francis,
Yes, it should be available with using Test Runner Environment Variables settings in Preferences | Build, Execution, Deployment | Unit Testing | Test Runner as is it mentioned in this Telerik post. As far as I am aware the recommended variables are:
But you can clarify the variables with Telerik Support. Please let me know how it goes or if you have any other questions.
Yes it works. Thank you !
Hi,
I tried to get JustMock working with Rider and xUnit.net.
However, the Exception ("The profiler must be enabled to mock, arrange...") is still thrown, even though I have configured the environment variables like in the Telerik post.
Here's an image of my configurations, the path to the dlls is also correct.
Is there anything else I'm missing?
Other infos: I'm running the EAP programm (JetBrains Rider 213.4293.18), using .NET 5 and C#.
Edit:
I just installed the current version of Rider (2021.2.1), and it seems to be working here. Should I create a new bug report for this?
Edit 2:
Sadly, this was just a coincidence because I had Visual Studio with the JustMock Extension running in the background. After closing Visual Studio, I couldn't run the tests anymore.
Is there some way to get these tests working without always running Visual Studio in the background?
Hi Christoph,
Please try setup environment variables globally, like it is described here or here.
The "Environment variables" field on the screenshot is for variables passed to Rider's Test Runner only. Check This doc page for details on this.
Hope it helps, have a nice day!
Thanks, I'll try it (set it up already, but currently don't have any tests to try it with).