Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
tools
vsnet.act
vsnet.debugging
vsnet.documentation
vsnet.enterprise.tools
vsnet.general
vsnet.ide
vsnet.jlca
vsnet.servicepacks
vsnet.setup
vsnet.vsip
vsnet.vss
vsnet.vstools.office
vstudio.development
vstudio.extensibility
vstudio.general
vstudio.helpauthoring
vstudio.setup
vstudio.sourcesafe
  
 
date: Wed, 6 Aug 2008 06:16:02 -0700,    group: microsoft.public.vsnet.enterprise.tools        back       


Problems with Code Coverage and Team Build   
Hi guys,

I've got a Team Project, which has unit tests. I created a Team Build, which 
has been running a while a works fine. 

I've since enabled code coverage "using "Edit Test Run Configuration". This 
works fine for local unit tests, but doesn't work for the MSBuild! I get the 
following error:

“MSBUILD : warning : Test Run Error.”

What’s even more frustrating, though, is that this failure leaves some files 
on the build server locked. One of these is data.coverage. When I then run 
further builds, the build barely starts, reporting that it can’t clear down 
the build folder. The only way I know to release the locks is to restart the 
build server!

So, my questions:

1) How do you clear locks on files on the build server. (Killing 
TFSBuildService.exe doesn’t work!)
2) How do you configure code coverage to work on the build server without 
errors?

Thanks in advance,

Steve.
date: Wed, 6 Aug 2008 06:16:02 -0700   author:   Steve Barker am

RE: Problems with Code Coverage and Team Build   
Hello Steve

1) How do you clear locks on files on the build server. (Killing 
TFSBuildService.exe doesn't work!)

You may use the tool: Process Explorer
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
It is capable of finding out the process that locks a certain file.

Step1. Run procexp -> Find menu -> Find Handle or DLL.
Step2. Input the locked file name (e.g. data.coverage in this case) to the 
Search box. Procexp will list all the processes that locks the file. 
(please let me know the search result)
Step3. Double clicking the process, and you will be switched to the 
procexp's main window, with the corresponding process selected.
Step4. In the View menu, select Lower Panel View -> Handles
Step5. In the lower panel view (Handles), find out the file (data.coverage) 
locked by the process. Right click on it and choose "Close Handle". This 
will release the lock of the file.

Please note that the above step list is not the standard way of using Team 
Build with code coverage. The step list is for the testing purpose.

2) How do you configure code coverage to work on the build server without 
errors?

The general steps to configure Code Coverage to work on the build server is:
Test Menu -> Edit Test Run Configuration -> Code Coverage -> Select the 
artifacts to instrument. -> Check in the change.

Have you ever edited the test run configuration xml file?

In addition, would you please check whether you have a Visual Studio 
instance running on the TFS server?

Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 1 business day is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Support Engineer by contacting 
Microsoft Customer Support Services (CSS) at 
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
date: Thu, 07 Aug 2008 09:07:09 GMT   author:   (Jialiang Ge [MSFT])

RE: Problems with Code Coverage and Team Build   
Hi Jialiang,

Thanks for getting back to me.

OK, I've downloaded Process Explorer. It looks like a useful tool! It 
appears that the process that's locked on to data.coverage is VSPerfMon.exe. 
When I release the handle as you suggest, the data.coverage file STILL can't 
be deleted. To delete the file, I have to completely kill the VSPerfMon.exe 
process.

Anyway, that resolves my first question, so thanks for that.

Now we have the issue of the code coverage stopping my automated builds from 
working.

Yes, I already know how to customise the Code Coverage in the Test Run 
Configuration, and I have never directly edited the XML; I only edit it using 
the UI.

Yes, VSTS is installed on the build machine. This is essential, as builds 
wouldn’t work at all otherwise! If I turn off code coverage, the automated 
builds work correctly. If I enable it, they don’t.

If I open VSTS on the build server and run the tests manually using Test 
Manager, they pass, but the code coverage fails with:

“Cannot initialize post instrumentation for the ASP.NET project 
'http://localhost/'.
Exception was thrown: 
Microsoft.VisualStudio.Enterprise.Common.AspNetHelperException: Running a 
website under profiling or code coverage requires that the controller be 
running under session 0.
   at 
Microsoft.VisualStudio.Enterprise.Common.AspNetHelper.SetupInstrument(Type 
type)
   at 
Microsoft.VisualStudio.TestTools.CodeCoverage.CoveragePlugIn.InitAspNetInstrumentation(TestRun testRun).
The code coverage data for this project may be incomplete.”

Does this help us to spot the problem?

Thanks again,

Steve.
date: Thu, 7 Aug 2008 03:53:01 -0700   author:   Steve Barker am

RE: Problems with Code Coverage and Team Build   
Hello Steve,

I've reproduced the error "Cannot initialize post instrumentation for the 
ASP.NET project..." in my VSTS 2005 system without VS 2005 SP1. The issue 
was fixed in SP1 and my test in a VSTS 2005 system with SP1 succeeds. Would 
you please make sure the service pack is applied on your build machine?

VSPerfMon.exe is started by MSTEST.exe. At the end of MSTEST.exe, the 
process shuts down VSPerfMon. In this case our VSPerfMon does not quit as 
expected, possibly because MSTEST failed or crashed, and the failure of 
MSTEST may possibly results from the above "Cannot initialize post 
instrumentation for the ASP.NET project..." issue. Therefore, applying VS 
SP1 may have a chance to fix the data.coverage lock issue in the meantime.

Regards, 
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
date: Fri, 08 Aug 2008 06:44:53 GMT   author:   (Jialiang Ge [MSFT])

RE: Problems with Code Coverage and Team Build   
Hi Jialiang,

Thanks for your reply.

I just checked the Build Server, and it has SP1 on it already. The full 
version is:

8.0.50727.762 (SP .050727-7600)

Any other ideas how I can fix this?

Thanks,

Steve.

""Jialiang Ge [MSFT]"" wrote:

> Hello Steve,
> 
> I've reproduced the error "Cannot initialize post instrumentation for the 
> ASP.NET project..." in my VSTS 2005 system without VS 2005 SP1. The issue 
> was fixed in SP1 and my test in a VSTS 2005 system with SP1 succeeds. Would 
> you please make sure the service pack is applied on your build machine?
> 
> VSPerfMon.exe is started by MSTEST.exe. At the end of MSTEST.exe, the 
> process shuts down VSPerfMon. In this case our VSPerfMon does not quit as 
> expected, possibly because MSTEST failed or crashed, and the failure of 
> MSTEST may possibly results from the above "Cannot initialize post 
> instrumentation for the ASP.NET project..." issue. Therefore, applying VS 
> SP1 may have a chance to fix the data.coverage lock issue in the meantime.
> 
> Regards, 
> Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> 
> =================================================
> Delighting our customers is our #1 priority. We welcome your comments and 
> suggestions about how we can improve the support we provide to you. Please 
> feel free to let my manager know what you think of the level of service 
> provided. You can send feedback directly to my manager at: 
> msdnmg@microsoft.com.
> 
> This posting is provided "AS IS" with no warranties, and confers no rights.
> =================================================
> 
>
date: Fri, 8 Aug 2008 07:17:00 -0700   author:   Steve Barker am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us