Ayende @ Rahien

Hi!
My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 18 | Comments: 84

filter by tags archive

Coverage during acceptance tests?

time to read 1 min | 154 words

I am using WATIN for integration tests, and I really like it. The only problem that I have with it now is that I can't get tests run via WATIN to be covered using NCover. This is understandable, since the tests are excersizing a different appdomain (and process, they are run on IIS). This is really sad, since I now have a great deal of focus on the UI, and this means that I can't get the proper stats about it.

I can't think of any way to make NCover profile another process, but I do think that it is possible to profile another appdomain, which bring up the possibility of hosting ASP.Net myself and running the tests against that. (This is basically what MonoRail TestSupport does, but I never checked it coverage).

I'll give it a try tomorrow, any comments before I try this?


Comments

Jeroen van Menen

Hi,

Following a section from the NCoverFAQ.html distributed with the 1.3 version. Haven't tried this myself but it might help you.

--> Start snippet

  1. How do I analyze an ASP.NET application with NCover?

xmspc got this to work on ASP.NET. See his post on the message board for more information. Here are the basics for getting it to work on Windows XP.

1) Ensure the NCoverLib COM component is registered (setup does this, but you can manually register it with regsvr32 if you wish).

2) Set the machine-wide COR profiling environment variables (or find some other way to get them set in the aspnet_wp.exe's environment):

CORENABLEPROFILING=1

COR_PROFILER=CvrLib.CoverageProfiler

3) Create %windir%\System32\Coverage.log and %windir%\System32\Coverage.xml and grant .\ASPNET read+write+modify permission to these 2 files only.

4) Force a restart of IIS so aspnet_wp.exe picks up the new environment variables. Coverage info will be written to the System32 directory.

All ASP.Net processes (on Windows XP for sure, don't know about Windows 2003) use %windir%\System32 as their working dir, therefore if multiple processes are running they will stomp over the Coverage files.

...would be nice if NCover used AppDomain basedir and/or value from app config file to set output file dir...

<-- End snippet

Kevin McDonnell

I've tried this before and ended up with all sorts of problems with PerfMon and IIS so be very careful with it!

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

  1. Buffer allocation strategies: A possible solution - 3 days from now
  2. Buffer allocation strategies: Explaining the solution - 4 days from now
  3. Buffer allocation strategies: Bad usage patterns - 5 days from now
  4. The useless text book algorithms - 6 days from now
  5. Find the bug: The concurrent memory buster - 7 days from now

There are posts all the way to Sep 11, 2015

RECENT SERIES

  1. Find the bug (5):
    20 Apr 2011 - Why do I get a Null Reference Exception?
  2. Production postmortem (10):
    03 Sep 2015 - The industry at large
  3. What is new in RavenDB 3.5 (7):
    12 Aug 2015 - Monitoring support
  4. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats