Jacoco version is 0.7.7.201606060606
Java version is 1.8.0_131
Ant version is 1.9.5
Following is the stacktrace of the error.
[jacoco:report] Loading execution data file /local/home/tcagent/TeamCityAgent/work/7cf8c5b5cc582291/build/tmp/pdk/jacoco/coverage/jacoco.exec
[12:22:35][jacoco:report] Unable to read execution data file /local/home/tcagent/TeamCityAgent/work/7cf8c5b5cc582291/build/tmp/pdk/jacoco/coverage/jacoco.exec
[12:22:35]
[antcall] The following error occurred while executing this line:
/local/home/tcagent/TeamCityAgent/work/7cf8c5b5cc582291/build/utils/buildinclude/build-quality.xml:1079: Unable to read execution data file /local/home/tcagent/TeamCityAgent/work/7cf8c5b5cc582291/build/tmp/pdk/jacoco/coverage/jacoco.exec
[12:22:35][Step 2/2] Process exited with code 1
[12:22:35][Step 2/2] Ant output
[12:22:35][Ant output] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
[12:22:35][Ant output] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[12:22:35][Ant output] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[12:22:35][Ant output] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[12:22:35][Ant output] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[12:22:35][Ant output] at java.lang.reflect.Method.invoke(Method.java:498)
[12:22:35][Ant output] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[12:22:35][Ant output] at org.apache.tools.ant.Task.perform(Task.java:348)
[12:22:35][Ant output] at org.apache.tools.ant.Target.execute(Target.java:435)
[12:22:35][Ant output] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[12:22:35][Ant output] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
[12:22:35][Ant output] at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
[12:22:35][Ant output] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[12:22:35][Ant output] at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
[12:22:35][Ant output] at org.apache.tools.ant.Main.runBuild(Main.java:853)
[12:22:35][Ant output] at org.apache.tools.ant.Main.startAnt(Main.java:235)
[12:22:35][Ant output] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
[12:22:35][Ant output] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
[12:22:35][Ant output] Caused by: java.io.EOFException
[12:22:35][Ant output] at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:340)
[12:22:35][Ant output] at java.io.DataInputStream.readUTF(DataInputStream.java:589)
[12:22:35][Ant output] at java.io.DataInputStream.readUTF(DataInputStream.java:564)
[12:22:35][Ant output] at org.jacoco.core.data.ExecutionDataReader.readExecutionData(ExecutionDataReader.java:148)
[12:22:35][Ant output] at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:115)
[12:22:35][Ant output] at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:92)
[12:22:35][Ant output] at org.jacoco.core.tools.ExecFileLoader.load(ExecFileLoader.java:59)
[12:22:35][Ant output] at org.jacoco.ant.ReportTask.loadExecutionData(ReportTask.java:514)
[12:22:35][Ant output] ... 121 more
[12:22:35][Ant output]
Following is the configuration for jacoco
<target name="jacoco"
depends="jacoco-help, jacoco-setup"
unless="help"
description="Turns on JaCoCo instrumentation/reporting">
<property name="jacoco.enabled" value="true" />
<property name="test.coverage.reporttarget" value="jacoco-generate-report" />
<path id="classpath-jacoco-runtime">
<fileset dir="${lib.dir}">
<include name="**/build/*jacoco*.jar" />
<include name="**/build/asm*.jar" />
</fileset>
</path>
<pathconvert property="test.coverage.runtimejars" refid="classpath-jacoco-runtime" />
</target>
<target name="jacoco-setup"
depends="java-setup"
unless="jacoco-setup.completed"
xmlns:jacoco="antlib:org.jacoco.ant">
<property name="jacoco.tmp.dir" value="${build.tmp.dir}/jacoco" />
<property name="jacoco.coverage.dir" value="${jacoco.tmp.dir}/coverage" />
<mkdir dir="${jacoco.coverage.dir}" />
<property name="jacoco.reports.dir" value="${build.report.dir}/jacoco" />
<mkdir dir="${jacoco.reports.dir}" />
<property name="jacoco.result.file" value="${jacoco.coverage.dir}/jacoco.exec" />
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath>
<path refid="classpath-build"/>
</classpath>
</taskdef>
<jacoco:agent property="test.coverage.jvmargs"
destfile="${jacoco.result.file}"
append="true"
enabled="true"
output="file"/>
<property name="jacoco-setup.completed" value="true"/>
</target>
<target name="jacoco-generate-report"
depends="jacoco-setup"
if="jacoco.enabled"
xmlns:jacoco="antlib:org.jacoco.ant">
<jacoco:report>
<executiondata>
<file file="${jacoco.result.file}"/>
</executiondata>
<structure name="JaCoCo Report">
<classfiles>
<fileset dir="${java.main.classdir}"/>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${java.main.src}" />
</sourcefiles>
</structure>
<html destdir="${jacoco.reports.dir}" />
</jacoco:report>
<antcall target="report-summary">
<param name="summary.section" value="quality"/>
<param name="summary.entry" value="jacoco"/>
<param name="summary.entry.url" value="jacoco/index.html"/>
<param name="summary.entry.link" value="JaCoCo"/>
<param name="summary.entry.text" value="JaCoCo code coverage reports."/>
</antcall>
</target>
Hi,
the exec file you provided is truncated. This probably means that the JVM running the test does not properly shut down.
Note that there is a known issue with Java 8. When the main thread is in the interrupted state the JVM shutdown hooks are not properly executed, see: https://bugs.openjdk.java.net/browse/JDK-8154017
Regards,
-marc
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/73c3f540-667a-412b-894c-5dc901228541%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Â
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+unsubscribe@googlegroups.com.
I'm working on the same project; is there anyway to prevent the report task from running until the test output is complete?
I would rather fix the incomplete report; any suggestions on how to stop the JVM from exiting prematurely while writing it?
Probably your execution file is not generated the right way.
Feel free to check out our solution here:
http://www.qalearningguide.com/2017/10/code-coverage-for-android-using-jacoco.html
Hope this helps you as well.
Thanks,
Suparna