coverage.txt, coverage, coverage.ec, coverage.em not being generated

Folks,

Not all of the necessary coverage files are being generated for my builds. I'm currently searching through the forum history but have yet found a definitive explanation for why this seems to happen sometimes. Pointers or an explanation would be appreciated.



LOG
==================================================
TeamCity 3.1.2 (build 6881) initialized, OS: Linux, JRE: 1.5.0_10-b03

: Compiling 1 source file to /mvn-repo/TeamCityBuildSpace/work/581f4d388668420b/build
: EMMA: Instrumenting classes (<1s)
: EMMA commandline:
: EMMA: processing instrumentation path ...
: EMMA: instrumentation path processed in 70 ms
: EMMA:
: EMMA: metadata merged into {in 8 ms}
: Adding debug=true parameter to javac task
: javac (<1s)
: Compiling 1 source file to /mvn-repo/TeamCityBuildSpace/work/581f4d388668420b/build
: EMMA: Instrumenting classes (<1s)
: EMMA commandline:
: EMMA: processing instrumentation path ...
: EMMA: instrumentation path processed in 8 ms
: EMMA:
: EMMA: no output created: metadata is empty
: Adding emma to classpath of JUnitTask.
: junit (<1s)
: Running dft.examples.AppTest
: dft.examples.AppTest (<1s)
: testApp (<1s)
: Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.109 sec
: Unable to find /mvn-repo/TeamCityBuildSpace/work/581f4d388668420b/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

2 comments
Comment actions Permalink

Hello Robert,

From your log I see only one class to be compiled and I bet this is test class itself.
Emma is configured to exclude Test classes from coverage collection (see param -ix, -Test in your log and in coverage page configuration).

If you want to test coverage collection, please add some production classes to your test and make sure these classes
are used when your test is run.

Hope this helps,
KIR

0
Comment actions Permalink

The problem was that my test code never actually interacted with any of the application code. Once I added some test code to actually interact with my application code, coverage information was generated and displayed as expected.

I'm no UI expert but IMO, the Code Coverage UI elements should be displayed even when there is no coverage data. This signals to the user that they are not getting all the possible build information. The way the UI works today, you don't know what you are missing.

0

Please sign in to leave a comment.