Artifacts path coverage.txt not found

RE: TeamCity Professional 3.1.1 (build 6828)

Folks,

I've looked at a bunch of other similar issues on this forum with code coverage results not being available after a build, but none of the issues seem to be quite the same as mine. Here's my scenario. I've got an Ant runner configured that uses the default working directory. I have code coverage enable, and I end up with coverage.es and coverage.em files in the Artifacts tab. However, I do not have a Code Coverage tab when I look at the build results. I noticed in one of the other posts on this forum that a coverage.txt file is needed before the Code Coverage tab will appear. That file is apparently not being generated. Here is the end of the build log (note that I searched for an OutOfMemory error in the logs, because someone else had posted about a similar issue, but I see no evidence of any such error). If anyone has any suggestions, please let me know.

: EMMA: runtime coverage data merged into {in 48 ms}
: EMMA: locking coverage output file ...
: EMMA commandline:
: EMMA: processing input files ...
: 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
: Publishing artifacts 'coverage.em' to root artifacts directory
: Build finished

9 comments

Hello Paul,

Please try adding attributes fork="true" and forkmode="once" to your junit task.

Hope this helps,
KIR

0

Kirill,

Thank you for the feedback. We have a number of junit invocations that are part of our build. I have gone through all of them (or at least I hope I have gone through all of them) and changed the settings per your suggestion. We were already forking the calls to junit, so I needed only to add the forkmode option. Here is an example of one such task:

]]>

Even with these changes, the coverage.txt artifact file is not generated. I turned on verbose logging to make sure I was using Ant 7.0. Here is some relevant output:

: junit (16s)
: Found /dev/common/apache-ant-1.7.0/lib/junit-4.4.jar
: Found /dev/common/apache-ant-1.7.0/lib/ant-launcher.jar
: Found /dev/common/apache-ant-1.7.0/lib/ant.jar
: Found /dev/common/apache-ant-1.7.0/lib/ant-junit.jar
: Execute:Java13CommandLauncher: Executing '/dev/common/jdk1.5.0_15/jre/bin/java' with arguments:
'-ea'
'-Didea.build.server.build.id=3841'
'-Dteamcity.buildType.id=bt1'
'-Didea.build.agent.port=9090'
'-Dagent.classpath=/opt/TeamCity/buildAgent/lib/utils.jar:/opt/TeamCity/buildAgent/lib/buildServerServerLogging.jar:/opt/TeamCity/buildAgent/plugins/coveragePlugin/lib/emma.jar:/opt/TeamCity/buildAgent/lib/xpp3_min-1.1.3.4.M.jar:/opt/TeamCity/buildAgent/plugins/antPlugin/lib/buildServerAntServerLogging.jar:/opt/TeamCity/buildAgent/lib/xstream-1.2.1.jar:/opt/TeamCity/buildAgent/lib/buildServerCommonRuntime.jar:/opt/TeamCity/buildAgent/lib/commons-codec-1.3.jar:/opt/TeamCity/buildAgent/lib/buildServerMessages.jar:/opt/TeamCity/buildAgent/lib/nanocontainer-1.0-RC-1.jar:/opt/TeamCity/buildAgent/lib/xmlrpc-2.0.1.jar:/opt/TeamCity/buildAgent/plugins/testNGPlugin/lib/testNGAntExtension.jar:/opt/TeamCity/buildAgent/plugins/coveragePlugin/lib/coverageAgentRuntime.jar:/opt/TeamCity/buildAgent/lib/buildServerXmlRpcWrapper.jar'
'-Dteamcity.build.checkoutDir=/opt/TeamCity/buildAgent/work/7573b74006230899'
'-Dteamcity.build.workingDir=/opt/TeamCity/buildAgent/work/7573b74006230899'
'-Dagent.work.dir=/opt/TeamCity/buildAgent/work'
'-Dant.task.extensions=jetbrains.buildServer.testng.TestNGTaskExtension,jetbrains.buildServer.coverage.AntCoverageAdapter,jetbrains.buildServer.agent.ant.CompilerAntExtension,jetbrains.buildServer.agent.ant.EchoAntExtension,'
'-Dagent.name=Default agent'
'-Dagent.home.dir=/opt/TeamCity/buildAgent'
'-Dagent.flow=1212016346689101000'
'-Dreport.html.out.file=coverage/index.html'
'-Demma.instrumentation.parameters=-ix -Test -ix +com.mycompany.*'
'-Demma.coverage.out.file=/opt/TeamCity/buildAgent/work/7573b74006230899/coverage.ec'
'-Demma.metadata.out.file=/opt/TeamCity/buildAgent/work/7573b74006230899/coverage.em'
'-Demma.rt.control=false'
'-classpath'
'/opt/TeamCity/buildAgent/work/7573b74006230899/build/util.jar:/opt/TeamCity/buildAgent/work/7573b74006230899/build/util_test.jar:/opt/TeamCity/buildAgent/work/7573b74006230899/ThirdParty/jaxws-ri/lib/activation.jar:/opt/TeamCity/buildAgent/work/7573b74006230899/ThirdParty/JavaMail/lib/mail.jar:/opt/TeamCity/buildAgent/work/7573b74006230899/ThirdParty/jaxws-ri/lib/jaxb-api.jar:/opt/TeamCity/buildAgent/work/7573b74006230899/ThirdParty/jaxws-ri/lib/jsr173_api.jar:/opt/TeamCity/buildAgent/work/7573b74006230899/ThirdParty/JSON/lib/json.jar:/opt/TeamCity/buildAgent/work/7573b74006230899/ThirdParty/telnetd/lib/telnetd.jar:/opt/TeamCity/buildAgent/work/7573b74006230899/ThirdParty/Apache/Jakarta/commons-httpclient/commons-httpclient.jar:/opt/TeamCity/buildAgent/work/7573b74006230899/ThirdParty/Apache/Jakarta/commons-codec/commons-codec.jar:/opt/TeamCity/buildAgent/work/7573b74006230899/ThirdParty/Apache/Jakarta/commons-logging/commons-logging.jar:/opt/TeamCity/buildAgent/lib/buildServerRuntimeUtil.jar:/opt/TeamCity/buildAgent/plugins/antPlugin/lib/buildServerAntRuntime.jar:/dev/common/apache-ant-1.7.0/lib/emma.jar:/dev/common/apache-ant-1.7.0/lib/junit-4.4.jar:/dev/common/apache-ant-1.7.0/lib/ant-launcher.jar:/dev/common/apache-ant-1.7.0/lib/ant.jar:/dev/common/apache-ant-1.7.0/lib/ant-junit.jar'
'org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner'
'com.mycompany.util.TestSuite'
'filtertrace=true'
'haltOnError=false'
'haltOnFailure=true'
'formatter=org.apache.tools.ant.taskdefs.optional.junit.SummaryJUnitResultFormatter'
'showoutput=false'
'outputtoformatters=true'
'logtestlistenerevents=true'
'formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter'
'formatter=jetbrains.buildServer.agent.ant.AgentJUnitFormatter'
'crashfile=/opt/TeamCity/buildAgent/work/7573b74006230899/MyApp/junitvmwatcher563740125.properties'
'propsfile=/opt/TeamCity/buildAgent/work/7573b74006230899/MyApp/junit1058630119.properties'

0

Hello Paul,

So far I can't figure out why coverage report is not generated.
Could you please send me build log and teamcity agent logs as described at
http://www.jetbrains.net/confluence/display/TCD3/Reporting+Issues page.

Kind regards,
KIR at jetbrains.com

0

Hi,

Was this ever resolved? I'm experiencing the same with TeamCity 3.1.1. The .em and .ec files get generated, then I get the following in the log:

: EMMA commandline:
: EMMA: processing input files ...
: 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
: Publishing artifacts 'coverage.em' to root artifacts directory
: Build finished

My two junit tasks have fork="true" and forkmode="once".

No exceptions in the log (except one from the unit tests about log4j.xml not being found, which is fine)

Thanks,

Jim

0

Hello Jim,

Unfortunately, I was unable to reproduce the problem locally. I'd appreciate if you could prepare a test case which reproduces it.
So far, if coverage.em and coverage.ec files are generated, coverage.txt and html reports are generated without problems :(.

Kind regards,
KIR

0

Sure - if you let me know an email address I can send over a zip of the project.

Thanks,

Jim

0

My email is my nickname at jetbrains.com

Thanks!

Regards,
KIR

0

Hello James,

In your project, there was another emma.jar library of different version than bundled with TeamCity.
As a result, EMMA couldn't create the report:

(FileOutputStream.java:179)
at java.io.FileOutputStream.(FileOutputStream.java:131)
at jetbrains.buildServer.coverage.CoverageSupport.createZip(CoverageSupport.java:250)
at jetbrains.buildServer.coverage.CoverageSupport.createReport(CoverageSupport.java:174)
at jetbrains.buildServer.coverage.AntCoverageAdapter$1.run(AntCoverageAdapter.java:39)
]]>



After removing your emma.jar, it worked just fine.

Kind regards,
KIR

0

Hello Paul,

I think I found the source of the problem with emma report. There is emma.jar in the lib directory of the ant you use to build the project in Teamcity.
As long as Teamcity uses own version of emma, there is a clash of versions.

Please try removing emma.jar from /dev/common/apache-ant-1.7.0/lib/emma.jar .

Hope this helps,
KIR

0

Please sign in to leave a comment.