Skipping JaCoCo execution due to missing execution data file

66 views
Skip to first unread message

joel.cos...@gmail.com

unread,
Dec 1, 2019, 1:17:41 AM12/1/19
to JaCoCo and EclEmma Users
Hi,

I'm the lead developer of AssertJ Core and I could use a bit of help trying to identify why jacoco is missing the execution data file.
It is likely something misconfigured but I can't put my finger on it.

You should be able to reproduce the issue by cloning https://github.com/joel-costigliola/assertj-core and executing

mvn clean jacoco:prepare-agent package jacoco:report -Dtest=StandardRepresentation_toStringOf_Test

(you can execute all the tests but there are more than 1000 so executing just one is way quicker).

I have verified that I was surefire plugin was configured with forkCount = 1 (so not 0).
The build run jacoco prepare-agent which outputs

[INFO] argLine set to -javaagent:/home/joel/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/home/joel/prog/assertj/assertj-core-3.x/target/jacoco.exec,excludes=**/*hamcrest*/** --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED
 --add-opens
 java.base/java.io=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED

I have executed the build in debug and found that surefire argline did not show jacoco destfile setting, I'm not sure if that's a problem ...

argLine = --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED
          --add-opens
          java.base/java.io=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED



My environment looks like:

Maven home: /home/joel/prog/apache-maven-3.5.3
Java version: 11.0.2, vendor: Oracle Corporation
Java home: /home/joel/.sdkman/candidates/java/11.0.2-open
Default locale: en_NZ, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-169-generic", arch: "amd64", family: "unix"


Any help  would be welcome as I'm running out of ideas.

Cheers

Joel Costigliola

Joel Costigliola

unread,
Dec 2, 2019, 4:34:04 AM12/2/19
to jac...@googlegroups.com
we found a workaround by removing the argLine settings in the java 9 maven profile, we are still not sure why this overrding the jacoco arg.

since assertj-core development continues, I have created a jacoco branch to reproduce the issue (don't use master branch anymore).

--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/8eQQzVXMIjs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/48ec4077-1931-4227-959f-1effd6e72d14%40googlegroups.com.

Evgeny Mandrikov

unread,
Dec 3, 2019, 6:05:54 AM12/3/19
to JaCoCo and EclEmma Users

 
On Sun, Dec 1, 2019 at 7:17 PM <joel.cos...@gmail.com> wrote:
I'm the lead developer of AssertJ Core and I could use a bit of help trying to identify why jacoco is missing the execution data file.
It is likely something misconfigured but I can't put my finger on it.

Hi Joel,


<plugin>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <argLine>${argLine}</argLine>
  </configuration>
</plugin>

whereas according to documentation of jacoco-maven-plugin goal prepare-agent ( https://www.jacoco.org/jacoco/trunk/doc/prepare-agent-mojo.html )
either argLine should be specified only as a property and not in configuration,
or syntax for late property evaluation ( http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#late-property-evaluation ) should be used.

Removal of argLine from configuration won't work, because it is also specified in parent pom ( https://github.com/joel-costigliola/assertj-maven-parent-pom/blob/assertj-parent-pom-2.2.6/pom.xml#L376 ) and therefore will be inherited - you can check this using help:effective-pom

According to my experiments for your project, use of late property evaluation works perfectly:

<plugin>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <argLine>@{argLine}</argLine>
  </configuration>
</plugin>



BTW nice to see that AssertJ uses JaCoCo! I added it to page https://github.com/jacoco/jacoco/wiki/Projects-that-use-JaCoCo


Regards,
Evgeny

Joel Costigliola

unread,
Dec 3, 2019, 4:51:45 PM12/3/19
to jac...@googlegroups.com
Thanks Evgeny for the help! We will use <argLine>@{argLine}</argLine>  as you suggested.

Cheers

--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/8eQQzVXMIjs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages