Example for Build.Bazel JUnit jacoco configuration

311 views
Skip to first unread message

cris.ar...@gmail.com

unread,
May 6, 2018, 11:29:18 PM5/6/18
to JaCoCo and EclEmma Users
Hi team,
Been trying to search for help on this. I have a pipeline that Bazel builds a microservice.
When It comes to code coverage, I get the below failure message from Jenkins.
Can you help me why I'm getting this error, i'm not an expert of Jacoco.

Jenkins log:
04:44:04.622 INFO: Analysing /tmp/jacoco.exec
04:44:05.321 INFO: ------------------------------------------------------------------------
04:44:05.321 INFO: EXECUTION FAILURE
04:44:05.321 INFO: ------------------------------------------------------------------------
04:44:05.322 INFO: Total time: 27.614s
04:44:05.630 INFO: Final Memory: 22M/2266M
04:44:05.630 INFO: ------------------------------------------------------------------------
04:44:05.630 ERROR: Error during SonarQube Scanner execution
04:44:05.630 ERROR: Unable to read /tmp/jacoco.exec
04:44:05.630 ERROR: Caused by: malformed input around byte 32
04:44:05.630 ERROR:
04:44:05.631 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
[Pipeline] }

## Junit
java_test(
name = "SomeClass",
srcs = [
"src/test/java/com/someclass/SomeClass.java",
],
test_class = "com.SomeClassTeat",
deps = [
"SomeTest",
"@javax_servlet_javax_servlet_api//jar",
"@org_springframework_spring_test//jar",
"@org_springframework_spring_web//jar",
"@org_mockito_mockito_core//jar",
"@net_bytebuddy_byte_buddy//jar",
"//commons-api/commons-api-server:CommonsApiServer",
],

size = "small",
jvm_flags = ["-javaagent:/tmp/jacocoagent-runtime.jar=destfile=/tmp/jacoco.exec"]
)

Marc Hoffmann

unread,
May 7, 2018, 7:32:34 AM5/7/18
to jac...@googlegroups.com
Hi,

the Sonarqube integration is not maintained here at the JaCoCo project.
Also the error message is not a JaCoCo message. Therefore please contact
Sonarqube directly for this issue.

Thanks,
-marc

Evgeny Mandrikov

unread,
May 7, 2018, 9:53:20 AM5/7/18
to JaCoCo and EclEmma Users
As an addition to what Marc said - error message "Unable to read jacoco.exec Caused by: malformed input around byte" typically indicates corrupted file.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages