Can't disable emma instrumentation for code coverage

I've looked for information on similar problems but it seems the majority of posts on code coverage are about turning it on.

My problem is that I can't turn it off and I'm getting instrumented classes no matter what I try.

Disabling code coverage doesn't work. I've tried to remove everything, creating new projects and build configurations, but it doesn't work either.

I'm running TeamCity 4.0 (build 8222) and my goal is to get code coverage and instrumentation only on the build configurations for staged artifacts, and then to be 100% sure that production code is not instrumented.

Have anybody else had these problems? Is there a known bug I might have missed? Any other suggestions on how to fix this?

Cheers
/O

3 comments
Comment actions Permalink

Do you clean classes before compilation? The situation you described is possible if a build with coverage has run on an agent and then on the same agent has started another build without coverage, but this build has not cleaned classes left from the previous build.

0
Comment actions Permalink

Ah! Thanks for the advice Pavel!

It is also stated below the code coverage checkbox "Add 'clean' target in your Ant build for this option to work." and I foolishly assumed that my build-file indeed had a clean target - but I was mistaken.

I'm going to ensure cleaning of the classes now and double check that it works as expected. I'll get back with a note on how it went.

0
Comment actions Permalink

Yes, the solution is to look twice and ensure that there is a clean-target in the build-file.

I was also being tricked by a WAR-file deploy to a Tomcat-server that kept stale versions of the problem classes.

Solved that by scripting a small move-aside-and-deploy-fresh for the stage-environment WAR-deploy to Tomcat.

Thanks again for the help.

0

Please sign in to leave a comment.