Generating test coverage data from a multi-language project

57 views
Skip to first unread message

Farzad Pezeshkpour

unread,
Jul 2, 2020, 9:18:55 AM7/2/20
to Clojure
Hi,

We are working with a multi-language project composed of a combination of Kotlin and Clojure modules. All modules have several unit and integration tests. During the build, we employ jacoco for getting coverage data for the Kotlin source.
What we would like to achieve is coverage data for both the Clojure and the Kotlin source during integration tests. The integration tests are written in Kotlin, and launched via JUnit.
I've looked at Cloverage - looks great. It's not entirely clear to me how I can integrate it with JUnit.  I wonder if anyone else has done something similar?

thanks,
Fuzz



Laurens Van Houtven

unread,
Jul 29, 2020, 7:59:02 PM7/29/20
to clo...@googlegroups.com
Hey Farzad,

Sorry for the late reply. I'm the person maintaining Cloverage, so I figured I'd share how I'd proceed.

Is it actually necessary for you to run Clojure tests via Junit? Cloverage works by instrumenting forms, so it has Opinions(TM) on how it wants to be run. However, most coverage tools should support similar output formats; Cloverage for example supports a plethora of them. Many of these formats support being merged by third party tools. Sometimes that's e.g. coveralls/codecov.io as a target.

so; TL;DR: maybe turn the problem on its head, don't try to run them simultaneously, run separately, merge later? (Effectively a similar approach to what you'd do if you had e.g. a "fast" path that uses an optional dependency and a fallback path and still want to get perfect coverage.)

hope that helps,
lvh


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/e21b420d-2419-4a70-9102-dbfd86e6330co%40googlegroups.com.

Farzad Pezeshkpour

unread,
Jul 30, 2020, 1:41:55 AM7/30/20
to clo...@googlegroups.com
Thank you Laurens

I guess that if our Clojure code was running in a distinctly separate process, it would be relatively simple to run Cloverage against that process. Unfortunately our challenge is that the clojure parts of our system are *embedded* within a single process together with other modules written in other JVM languages. The JUnit integration tests exercise the entire stack, so they definitely need to be running. Perhaps there's some way we can initialise Cloverage during the JUnit test suite initialisation, against these specific Clojure module? I will keep experimenting. Thanks again.

On 30 Jul 2020, at 02:58, Laurens Van Houtven <_@lvh.io> wrote:


Reply all
Reply to author
Forward
0 new messages