Emma code coverage not showing on TeamCity 2.1.1/Windows

We just upgraded to TeamCity 2.1.1 (don't get me started, I know 3 is current, things take a while a my company), and we're unable to get the Emma code coverage report to show up at all.

We've configured our projects exactly like we did in TeamCity 1 (checking the code coverage checkbox, etc), but when the build and tests are done, no code coverage shows at all in the TC pages, and there's no "Code Coverage" tab visible.

We do see Emma messages during compilation on the build agents, and a 500 kb file is generated.

Our environment is:
Windows Server 2003 R2
JDK 1.4.2_15
Ant 1.7


Any ideas? As we just got upgraded to TC 2.1.1, upgrading to TC 3 (and having to buy enterprise licenses) probably won't happen for quite a while...

Any help would be greatly appreciated


Douglas Bullard

7 comments

I should have also added that we're running JUnit 3.8.1...

0

Hello,

Do you know that existing customers qualify for free upgrade to 3.1.1 version? Take a look at this page: http://www.jetbrains.com/teamcity/buy/index.html#upgradeuser_enterprise

--
Pavel Sher

0

Yes, but our "process" makes such upgrades difficult and slow. "Free" to management means almost nothing - what they hear is "change".

Actually, in reading the license agreement, it wouldn't be free at all to upgrade - we are currenly using four agents, and need to move to eight or more. That would actually cost us a considerable amount - an unbudgeted amount. The free upgrade only allows three agents, so that would be a very hard sell at this time.

Does the Emma coverage work with 2.1.1?


Douglas Bullard

0

Hello Douglas,

EMMA coverage works in 2.1.1. There may be cases when it fails (for instance, when using non-standard compile task) but it definitely worked.
When collecting coverage, there are following steps:
1. compilation. on this stage, EMMA performs instrumentation of class files and creates coverage.em file with coverage metadata. It also collects source paths of java files to generate report later.
2. test run. On this stage, actual runtime coverage information is collected. This process results in creation of the file coverage.ec
3. report generation. When build ends, TeamCity generates HTML coverage report, creates a zip file with the report (coverage.zip) and uploads it to the server.

Please take a look at the build log, these steps should be logged there, and all of them are marked with "emma" line, so you can Ctrl-F.

BTW, as I remember, when upgrading to TC3.0 you get number of agent licenses which is equal to number of previously bought user licenses for 2.1.

Kind regards,
KIR

0

I've tried to paste the output from our build, and keep getting an error. I'm trying a much shorter post, maybe that'll work.

The only EMMA output we see is during compilation - nothing during test runs. After the test runs, I see this output in the logs (mixed with other output):

Artifacts path coverage.ec not found
Artifacts path coverage.text not found
Artifacts path coverage not found

Publishing artifacts target/docs to root artifacts directory
Artifacts path target/docs not found
Done publishing artifacts target/docs, total files published: 0
Publishing artifacts coverage.ec to root artifacts directory
Artifacts path coverage.ec not found
Done publishing artifacts coverage.ec, total files published: 0
Publishing artifacts coverage.em to root artifacts directory
Done publishing artifacts coverage.em, total files published: 1
Publishing artifacts coverage.txt to root artifacts directory
Artifacts path coverage.txt not found
Done publishing artifacts coverage.txt, total files published: 0
Publishing artifacts coverage to root artifacts directory
Artifacts path coverage not found
Done publishing artifacts coverage, total files published: 0
Build finished: 6889

0

Hello Douglas,

It looks like runtime coverage information is not collected in your case (coverage.ec is not found).
Could you please send me (kir jetbrains com) your logs from the build agent (buildAgent/logs/teamcity.log), screenshot with your emma settings in TeamCity and your build script (or, at least, compilation and test tasks from your build script).

I'll try to figure out why your configuration doesn't work.

Regards,
KIR

0

I think I've already found the answer.

We had a number of in-container tests which we were running, so we had to distribute the emma.jar so the container wouldn't get NoClassDefNotFoundErrors. It turns out that you've got a different version of emma that's used by TC than what's in their archive, and that was causing an error.

So, we got our regular unit tests to work by replacing the "normal" version of emma with the TC version.

Curiously, though, none of the in-container tests seem to generate any test data - we only get data from the unit tests. As we have to start the container up by running a batch script, are there some arguments which could be passed to get it to properly record it's coverage?

FYI, we're running ATG (ugh!) under JDK 1.4.2_15 (ack!)

Thanks,

Douglas Bullard (still working on getting us upgraded to TC 3)

0

Please sign in to leave a comment.