Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Using NCrunch with JustMock
Thorsten Vogt
#1 Posted : Friday, December 16, 2011 10:01:06 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/16/2011(UTC)
Posts: 3

Hi,

I just installed NCrunch and tests using JustMock Profiler fail. Is there a way to get them work together? Maybe it is possible to modify the way NCrunch is invoked. See also http://www.telerik.com/c...nunit-and-partcover.aspx
Remco
#2 Posted : Friday, December 16, 2011 10:59:58 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi Thorsten -

Thanks for posting! So far no support has been added for JustMock, though I believe this should be a simple process. I will see what I can do about adding it in a future release. I'm afraid I can't offer you a workaround as there is no configuration that can override the task runner used to host the test environment.


Cheers,

Remco
Remco
#3 Posted : Wednesday, February 1, 2012 12:21:39 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
For anyone interested, support for JustMock has been added to the 1.37b release that went out this morning. There are no configuration steps required for this - NCrunch should automatically adapt and configure itself.
Thorsten Vogt
#6 Posted : Friday, June 8, 2012 6:41:17 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/16/2011(UTC)
Posts: 3

Hi Remco,

JustMock support seems not to be working in current version (1.39.0.15b) anymore. I get a Telerik.JustMock.MockException : Profiler must be enabled. Running my tests inside ReSharper Testrunner succeeds.

Regards,

Thorsten
Remco
#7 Posted : Friday, June 8, 2012 8:29:55 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi Thorsten,

Can you share any more information about the version of JustMock you're using? Did this problem surface immediately after upgrading NCrunch?
Thorsten Vogt
#8 Posted : Friday, June 8, 2012 9:20:45 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/16/2011(UTC)
Posts: 3

I'm currently using JustMock Q1 2012 SP1 (2012.1.508.6) and I'm unfortunately not quite sure if the problem occurs after upgrading NCrunch or JustMock.
Remco
#9 Posted : Friday, June 8, 2012 11:08:22 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Thanks - I'll give it a try and will get back to you!
Remco
#10 Posted : Friday, June 8, 2012 11:15:29 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Something I noticed before looking into this in detail: http://gimparm.blogspot....ling-profiler-from.html

It appears that Telerik have introduced an extra environment variable in a new version. NCrunch doesn't supply this, so likely the auto integration will fail. The 1.40b release is getting quite close, so I'll see what I can do about including a fix for this. You may be able to work around the issue by creating your own proxy task runner .exe (as described in the blog above), and configuring NCrunch to use it by setting the 'Proxy process file path' option on your test projects.
Remco
#11 Posted : Monday, June 11, 2012 11:00:56 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi Thorsten -

I've been having difficulty reproducing the problem you've described while using the same version of NCrunch/JustMock, and I'm wondering if there may be something in your environment that's surfacing a problem.

When your tests are running with NCrunch and JustMock, do you see a 'nCrunch.JustMockProxyProcess.exe' process running anywhere inside windows task manager?
yanglee
#12 Posted : Monday, August 6, 2012 11:42:50 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2012(UTC)
Posts: 89
Location: China

Thanks: 23 times
Was thanked: 19 time(s) in 18 post(s)
Just installed JustMock trial and have experienced the same issue as Thorsten (Resharper works just fine with JustMock).

I'm using the latest versions of JustMock and NCrunch:
* JustMock Q2 2012 (2012.1.608.2)
* NCrunch 1.40b
* Visual Studio 2010 with SP1

I didn't found 'nCrunch.JustMockProxyProcess.exe' running inside windows task manager when running JustMock tests with NCrunch.
Remco
#13 Posted : Tuesday, August 7, 2012 8:44:00 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi Yanglee, thanks for posting!

Do you have any references from your test project to a Telerik.JustMock.dll? NCrunch looks for a reference to this assembly in order to determine whether to use the JustMock proxy process. I'm wondering if its possible that the version of JustMock you're using perhaps doesn't require this DLL or maybe uses something different?
yanglee
#14 Posted : Tuesday, August 7, 2012 9:12:21 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2012(UTC)
Posts: 89
Location: China

Thanks: 23 times
Was thanked: 19 time(s) in 18 post(s)
Hi Remco,

Yes, I have added reference from test project to Telerik.JustMock.dll. And also enabled JustMock in Visual Studio via menu > Telerik > JustMock > Enable JustMock.

See the following example. NCrunch throws exception at line 20, while Resharper works just fine.


Remco
#15 Posted : Tuesday, August 7, 2012 10:45:30 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
On your NCrunch project-level configuration, you'll find an option called 'Proxy process file path'.

Underneath your NCrunch installation directory (normally C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2010), you'll find a file called 'nCrunch.JustMockProxyProcess.exe'.

What happens if you set the 'Proxy process file path' to be the absolute file path of the just mock proxy process executable? Note that you'll need to do this for each project that uses JustMock in its test environment.
yanglee
#16 Posted : Tuesday, August 7, 2012 11:09:53 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2012(UTC)
Posts: 89
Location: China

Thanks: 23 times
Was thanked: 19 time(s) in 18 post(s)
I followed your instruction, now I can see 1~4 instances of nCrunch.JustMockProxyProcess.exe in Windows Task Manager when running JustMock tests with NCrunch.

But I still get the same exception as above. I tried to restart Visual Studio, but same issue.
Remco
#17 Posted : Tuesday, August 7, 2012 10:03:06 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Thanks for trying this. The existence of the proxy processes means that NCrunch should now be properly hosting the JustMock profiler but the profiler is not properly initialising itself within the test process. This is the same problem that Thorsten has been reporting and I have so far been unable to reproduce it locally.

I'm afraid that there may very be little I can do to fix this. The original integration with JustMock was done roughly a year ago, and since then there have been new versions of JustMock with apparently large differences in how the integration needs to work. Hosting 3rd party profilers within the NCrunch test process has proven to be complex and difficult to stabilise for all environments and profiler versions. Considering the amount of time that has been spent (and apparently wasted) by trying maintain these integration points, I need to make a strategic decision and look at putting time towards other things that are sure to make NCrunch a better product for a wider range of users.

I'll leave the existing integration in place in the hope that it may work for others who are running earlier versions of JustMock/TypeMock, but as of this time the integration with JustMock and TypeMock with NCrunch is no longer officially supported.

I'm sorry if this causes issues with your development.


Cheers,

Remco
yanglee
#18 Posted : Tuesday, August 7, 2012 11:00:51 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2012(UTC)
Posts: 89
Location: China

Thanks: 23 times
Was thanked: 19 time(s) in 18 post(s)
Understood. Thanks for your detailed reply.

This issue doesn't affect me much as I have used JustMock trial version only a few hours :)

Cheers,
Yang
nhoki
#19 Posted : Friday, October 19, 2012 10:23:34 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/19/2012(UTC)
Posts: 1
Location: Austria

Dear Remco,

are there any news or plans regarding the support of JustMock in the future?
I would really like to use NCrunch (as a commercial license), as I love the way it works in the background.
But I heavily relay on a Mocking Framework for legacy code base.

best regards
Bernhard



Remco
#20 Posted : Friday, October 19, 2012 10:42:53 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi Bernhard,

Thanks for your interest in NCrunch. I'm sorry to say that I haven't found a way to resolve the above problem from the side of NCrunch, so unless it's somehow solved in JustMock, I don't think there will be a solution to this in the immediate future.

JustMock does still work with non-elevated functions inside the NCrunch test runner, although as you've mentioned you're using it for mocking with legacy code, my guess is that the elevated functions are probably very important for your situation.

I'll post any updates here as/if I become aware of them.


Thanks again,

Remco
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.126 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download