Other modes of coverage data collection besides FILE and TCP?

39 views
Skip to first unread message

Ala Batarseh

unread,
Nov 16, 2022, 1:35:13 PM11/16/22
to JaCoCo and EclEmma Users
Hello,
I have been using Jacoco for years now. A great tool.
Recently I ran into a limitation of opening TCP ports on our network and thought I should ask here before I create my own solution.

Is there any support for collecting coverage data besides TCP and FILE. Ideally, I would like to have an option to dump the exec file over HTTP or FTP maybe.

I did some search and rechecked the documentation, but couldn't find any feature. Maybe there is a feature planned for later or maybe a plugin that I can use.

Thank you,
Ala

Marc Hoffmann

unread,
Nov 17, 2022, 6:07:01 AM11/17/22
to JaCoCo and EclEmma Users
Hi Ala,

all output options are documented here: https://www.jacoco.org/jacoco/trunk/doc/agent.html

There is no HTTP or FTP support.

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/c7325f19-86db-4b97-b54a-0413b4779ac9n%40googlegroups.com.

Ala Batarseh

unread,
Nov 27, 2022, 10:21:49 PM11/27/22
to JaCoCo and EclEmma Users
Thank you Marc for your response.
I am aware of what is supported currently and have been using Jacoco for many years now and plugged it in many of our projects here at Indeed. The issue I am running into as I mentioned is a limitation on our n/w setup in AWS where TCP traffic is not allowed and I thought others may run into similar situation. I was wondering if there is a plan or thoughts for supporting other protocols with Jacoco agent or maybe some other tool/plugin I can use.

My current plan is to create a REST service in the same n/w as the instrumented service and act as a proxy. This way I have the flexibility to offer coverage exec data on demand. 

Marc Hoffmann

unread,
Nov 28, 2022, 1:34:48 AM11/28/22
to JaCoCo and EclEmma Users
Hi Ala,

yes, probably having a project specific “side car” is the best solution. Exposing a http endpoint comes with many more questions like authentication, TLS certificates and so on which will probably add many dependencies to the JaCoCo agent. Therefore I don’t see this in JaCoCo and there are no plans to implement this.

You’re probably aware that JaCoCo comes with a runtime API, which can be used from within the deployed application: https://www.jacoco.org/jacoco/trunk/doc/api/org/jacoco/agent/rt/package-summary.html

Thanks for using JaCoCo!

Regards,
-marc




Ala Batarseh

unread,
Nov 29, 2022, 8:55:40 PM11/29/22
to JaCoCo and EclEmma Users
Hi Marc,
Another question, please.
Maybe this has been covered, but couldn't find a definite answer. For the FILE mode, is it supported to copy the .exec file to a network share instead of a local path.

BTW, I am already using org.jacoco.core.tools.*, org.jacoco.core.data.* and org.jacoco.core.analysis.* packages in my solution since my client (the client that collects coverage) is not running in the same JVM as the instrumented app. I don't think I can use the IAgent in my case as per the documentation, unless I missed something.

Thanks again for your help and support,
Ala

Marc Hoffmann

unread,
Nov 30, 2022, 4:00:39 AM11/30/22
to JaCoCo and EclEmma Users
Hi Ala,

sure, if the network share is mounted in the local file system this makes no difference for the JaCoCo agent.

Note that JaCoCo locks the exec file to allow output to the same file. Depending on the fileserver you’re using locking might not be supported and concurrent writes to the same file may corrupt it.

Regards,
-marc

Reply all
Reply to author
Forward
0 new messages