Missing Code Coverage output

Hi!

I integrated coverage, but see no coverage output. Could you please tell me what is wrong? Thanks.

EMMA messages in the log:

: EMMA commandline:
: EMMA: processing instrumentation path ...
: EMMA: instrumentation path processed in 3362 ms
: EMMA:
: EMMA: metadata merged into {in 62 ms}
...
...
...
: EMMA: Instrumenting classes (2s)
: EMMA commandline:
: EMMA: processing instrumentation path ...
: EMMA: instrumentation path processed in 2846 ms
: EMMA:
: EMMA: metadata merged into {in 78 ms}
...
...
...
: java (2m:21s)
: EMMA: collecting runtime coverage data ...
...
...
...
: EMMA: locking coverage output file ...
: EMMA: runtime coverage data merged into {in 62 ms}
: ant (1s)
: unitTest (<1s)
: Adding emma to classpath of JUnitTask.
: junit (<1s)
: Running com.NNN.cp.ai.attribute.meta.MetaAttributeMapTest
: com.NNN.cp.ai.attribute.meta.MetaAttributeMapTest (<1s)
: testMetaAttributeMap (<1s)
: EMMA: collecting runtime coverage data ...
: Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.203 sec
: EMMA commandline:
: EMMA: processing input files ...
: EMMA: 2 file(s) read and merged in 657 ms
: EMMA: not all instrumented classes were compiled with source file
: EMMA: debug data: no sources will be embedded in the report.
: EMMA: line coverage requested in a report of type but
: EMMA: not all instrumented classes were compiled with line number
: EMMA: debug data: this column will be removed from the report.
: EMMA: showing up to 3 classes without full debug info per package:

...
...
...

: Publishing artifacts (<1s)
: Paths to publish:
: Publishing artifacts 'F:/TeamCity/buildAgent/work/build/xxx/main/coverage.txt' to root artifacts directory
: Artifacts path F:/TeamCity/buildAgent/work/build/xxx/main/coverage.txt not found
: Publishing artifacts 'F:/TeamCity/buildAgent/work/build/xxx/main/coverage' to root artifacts directory
: Publishing artifacts 'F:/TeamCity/buildAgent/work/build/xxx/main/coverage.ec' to root artifacts directory
: Publishing artifacts 'F:/TeamCity/buildAgent/work/build/xxx/main/coverage.em' to root artifacts directory
: Build finished


Artifacts on WebUI:

  • acoverage.rb1.12Kb

  • all1.html292.20Kb

  • coverage.ec19.10Kb

  • coverage.em14.4Mb

  • coverage.rb1.99Kb

  • coverage.zip40b

  • intersect.rb619b

  • report.rb1.55Kb

12 comments
Comment actions Permalink

I thought my build has some sub-standard staff, so I added ipr build. The build fails to build with the error below, even after I removed my junit targets from the ant files. Now it looks like TC creates a junit target on the fly and than fails to execute, because there are no ant plug-in for junit.

: junit (<1s)
: Could not create task or type of type: junit.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
- You have misspelt 'junit'.
Fix: check your spelling.
- The task needs an external JAR file to execute
and this is not found at the right place in the classpath.
Fix: check the documentation for dependencies.
Fix: declare the task.
- The task is an Ant optional task and the JAR file and/or libraries
implementing the functionality were not found at the time you
yourself built your installation of Ant from the Ant sources.
Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
task and make sure it contains more than merely a META-INF/MANIFEST.MF.
If all it contains is the manifest, then rebuild Ant with the needed
libraries present in ${ant.home}/lib/optional/ , or alternatively,
download a pre-built release version from apache.org
- The build file was written for a later version of Ant
Fix: upgrade to at least the latest release version of Ant
- The task is not an Ant core or optional task
and needs to be declared using . - You are attempting to use a task defined using or ]]> but have spelt wrong or not
defined it at the point of use

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.
: Ant output:
Fix: upgrade to at least the latest release version of Ant
- The task is not an Ant core or optional task
and needs to be declared using . - You are attempting to use a task defined using or ]]> but have spelt wrong or not
defined it at the point of use

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.
at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:493)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:391)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:158)
at org.apache.tools.ant.Task.perform(Task.java:363)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 2 minutes 20 seconds
: Process exit code: 1

0
Comment actions Permalink

Ipr Pre/Post Processing Ant scripts do not allow defining ANT_HOME as it is done with the AntRunner. Also there is no way to report JIRA for TeamCity. TeamCity is a component of IDEA, but the project for it is IDEA-feedback, which does not include TeamCity as component. The only way to report bugs is via this forum, which is not manageable. Is that the same for paid users of TeamCity?

0
Comment actions Permalink

Hello Vadim,

In your case the problem occurs because of line "not all instrumented classes were compiled with line number" reported by EMMA.
There are several answers to this problem at EMMA's site, please check http://emma.sourceforge.net/faq.html#q.report.warnings

Please read about other possible code coverage issues at http://www.jetbrains.net/confluence/display/TCD4/Code+Coverage

Hope, this helps,
KIR

0
Comment actions Permalink

Vadim,

I suppose you use some explicitly set ANT_HOME. Could you please try running your build without specifying Ant home, i.e.
use the one provided by TeamCity.

Regards,
KIR

0
Comment actions Permalink

Vadim,

TeamCity is a not a component of IDEA, but a separate product. It uses a separate tracker: http://jetbrains.net/tracker

And yes, there are plenty of paid users for TeamCity.

Regards,
KIR

0
Comment actions Permalink

Hi Kirill!

Thanks for the answers.

What I meant is do you get the same support for paid and unpaid users?

0
Comment actions Permalink

Hello Vadim,

We provide equal support to paid and non-paid users of TeamCity, and we aspire to keep it at a decent level :)

Regards,
KIR

0
Comment actions Permalink

Hi Kiril!

I am almost there. The coverage report now shows, but not down to the source level. I assume the report would allow to click through and see the actual lines of code, right? The project structure is as follows:

project\
comp1\com\..
comp2\com\..
comp3\com\..

The build.xml file has javac target for each folder. How do I specify location of the sources or where do I copy them to? Thanks.

0
Comment actions Permalink

Hello Vadim,

I cannot help you unless you attach a full build log. Your problem may be caused by some code instrumentation made by some other tools (like javac2).
Please read about possible reasons of the problem at emma site (see link in this thread).

Regards
KIR

0
Comment actions Permalink

Hi Kirill!

I attached the log zipped with a password. The password is the 5 letter name of your favorite football team all lower case. There are no errors or warnings though. Thanks.



Attachment(s):
build.log.zip
0
Comment actions Permalink

Hi Vadim,

Could you please attach the build log from the Web UI (there is a download link in the right up corner).
I suppose that the problem with coverage is somehow connected with your directory structure.

Please also take a look at the F:\TeamCity\buildAgent\work\build\barraone\main\ directory after the build - is there coverage.zip file?

Regards,
KIR

0
Comment actions Permalink

Hi!

I am wondering if what I get is actually what I was supposed to get. Here is the EMMA report for the class. Am I supposed to get the whole source displayed with executed lines highlighted?

I just discovered that IDEA8 lets you download the coverage from TeamCity build and view it inside the IDE, which is even better. So I am not that interested in getting it fixed now. Thank you.


EMMA Coverage Report (generated Tue Nov 11 20:59:40 GMT 2008)
[com.barra.cp.ai.attribute.meta]
COVERAGE SUMMARY FOR SOURCE FILE
name class, % method, % block, % line, %
NullMetaAttribute.java 100% (1/1) 67% (2/3) 75% (9/12) 75% (3/4)
COVERAGE BREAKDOWN BY CLASS AND METHOD
name class, % method, % block, % line, %

class NullMetaAttribute 100% (1/1) 67% (2/3) 75% (9/12) 75% (3/4)
booleanValue (): Boolean 0% (0/1) 0% (0/3) 0% (0/1)
]]> 100% (1/1) 100% (5/5) 100% (1/1)
NullMetaAttribute (): void 100% (1/1) 100% (4/4) 100% (2/2)



[com.barra.cp.ai.attribute.meta]
EMMA 0.0.0 (unsupported private build) (C) Vladimir Roubtsov



Attachment(s):
BarraOne_BarraOne-Main_430.log.zip
0

Please sign in to leave a comment.