开发者

TFS 2010 Build Automation - Enabling Code Coverage

开发者 https://www.devze.com 2023-02-06 03:58 出处:网络
How do you enable code coverage for unit testing in TFS2010 automatic build? In Visual Stud开发者_如何转开发io 2010 we enabled Code Coverage for our test projects (Test --> Edit Test Settings --> Loc

How do you enable code coverage for unit testing in TFS2010 automatic build?

In Visual Stud开发者_如何转开发io 2010 we enabled Code Coverage for our test projects (Test --> Edit Test Settings --> Local Test Settings --> enable Code Coverage and choose assemblies to run code coverage against).

Now this is working fine (we can read code coverage) when running from Visual Studio 2010 (Test --> Run --> All Test In Solution).

The problem is that no code coverage is reported in TFS 2010 when building.

Note that the test projects are used by the build controller but without any code coverage.

Is very important for us to enable code coverage together with unit testing.


I forgot to mention that the problem I'm encountering has to do with code coverage for a web application project.

At step: Test --> Edit Test Settings --> Local Test Settings --> enable Code Coverage and choose assemblies to run code coverage against

when choosing assemblies you can choose the web application. I think that the problem is related to Path (the value under the Path column from wizard) which is the one from developer machine (http://localhost...). When building and deploying with TFS the build goes on one server and the deployment on another.

The question should be now: which path should be available in testsettings. The build path or the deployment path?

Currently I'm not at work and can't test my doubts. I'll let you know as soon as I get in touch with TFS.


You need to tell the build server which test settings file to use. You will find this in the build settings under Process >2. Basic >Automated Tests >1. Test Assembly >TestSettings file.

Once you have that specified then the Code coverage should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消