Error generating Emma Report

I'm having trouble generating the Emma report for my project. I am using Ant 1.7 (both in ANT_HOME and in TeamCity configuration). Instrumentation appears to be fine, as I'm getting the following messages on the build log:

: EMMA: Instrumenting classes (<1s)
: EMMA commandline:
: EMMA: processing instrumentation path ...
: EMMA: instrumentation path processed in 172 ms
: EMMA:
: EMMA: metadata merged into {in 62 ms}

The unit test execute, some of them fail (this is the expected behaviour) and the coverage.em file is created on the checkout folder. I haven't set a working folder in TeamCity configuration, because the project doesn't have any modules.

My ant file is located in /ant/build.xml, and a base dir of ".." as you can see here:

<project name="XXXXXX" default="default" basedir="..">

When the tests finish, I get the following errors:

: Unable to find D:\TCBuildAgent\work\741796eb2b4d6e6a\coverage.ec, cannot create EMMA report
: Process exit code: 0
: Publishing artifacts (<1s)
: Paths to publish:
: Publishing artifacts 'coverage.txt' to root artifacts directory
: Artifacts path coverage.txt not found
: Publishing artifacts 'coverage' to root artifacts directory
: Artifacts path coverage not found
: Publishing artifacts 'coverage.ec' to root artifacts directory
: Artifacts path coverage.ec not found
: Publishing artifacts 'coverage.em' to root artifacts directory
: Build finished

And consequently, I don't have coverage reports in the build page. I have searched for the coverage.ec file in the checkout folder, but I can't find it anywhere.

The logs on the agent tell me basically the same thing (with additional lines):

INFO - nt.runner.GenericProgramRunner - EMMA: processing instrumentation path ...
INFO - nt.runner.GenericProgramRunner - EMMA: instrumentation path processed in 172 ms
INFO - nt.runner.GenericProgramRunner - EMMA:
INFO - nt.runner.GenericProgramRunner - EMMA: metadata merged into {in 62 ms}
INFO - nt.runner.GenericProgramRunner - fileset: Setup scanner in dir D:\TCBuildAgent\work\741796eb2b4d6e6a\src\Java with patternSet
INFO - nt.runner.GenericProgramRunner - No sources found.
INFO - nt.runner.GenericProgramRunner - No sources found.

Don't know if the "No sources found" error is related, but the javac task is configured with the srcdir attibute so that TeamCity can include the sources in the coverage report. Obviously the option to include the sources in the coverage report is selected in the Teamcity configuration.

What I'm I doing wrong? Any help is greatly appreciated!

Thanks in advance,

Jos

3 comments

Hello Jos,

It looks like runtime information wasn't collected when your tests were run. Build log should contain records from emma about collecting runtime coverage information, such message should appear at the start of test execution. Please take a look.

I'd appreciate if you create an issue in our tracker and attach relevant information at: http://jetbrains.net/tracker/

Thanks!

KIR

0

Was a bug ever filed for this issue? I think I may have just hit my head on this.

0

Hello Robert,

Please make sure that your junit task has attribute fork=true. The recommended combination of attributes is "fork=true forkmode=once".
Please see how TeamCity's coverage is collected at http://www.jetbrains.net/confluence/display/TCD4/Code+Coverage

Hope this helps,
KIR

0

Please sign in to leave a comment.