Cannot generate JaCoCo report - JaCoCo tool not found
I am using Teamcity Enterprise 2019.1.1 (build 66192). I was using Teamcity service messages to generate the JaCoCo code coverage report.
I use a similar format like this
##teamcity[jacocoReport dataPath='jacoco.exec' includes='com.package.core.*' classpath='classes/lib/some.jar' reportDir='temp/jacocoReport']
But after the new Teamcity update, I get the following error.
Cannot generate JaCoCo report - JaCoCo tool not found
What is happening wrong ? Is there some change ?
Please sign in to leave a comment.
Hi,
do you have Jacoco added as a tool under Administration - Tools?
It seems to be there, Still it doesn't work. Should I be doing something else also ?
It seem the coverage runtime for jacoc is missing.
Hi all,
With 2019.1 we introduced a new feature whereas tools are only distributed when the agents are going to run a build that requires it. Unfortunately, passing it as a service message is too late for teamcity to realize that it needs the jacoco tool installed, and thus it fails to find the tool. I confirmed this as a bug with the devs and they're working on fixing it.
There should be two easy workarounds here:
-Enable Jacoco directly on the builds if possible
-Set up a build parameter that references the tool. With that reference, teamcity will understand that it needs the tool and will download it.
While the devs are informed and working on it, please feel free to watch and vote for the issue here: https://youtrack.jetbrains.com/issue/TW-61801
I did something like that to solve it. I just explicitly told that that build step needs the code coverage and added JACOCO as the code coverage tool to it even though it only uses service messages, then it was working with service messages
Could be cool if it works directly for service messages.
We're experiencing the same issue.
May I ask how specifically to apply the 2nd mentioned workaround?
In other words, how do I set up a build parameter that references the jacoco tool?
Thanks in advance,
Tomer R.
Just specify in the build step that it needs jacoco, but in turn I run the the code coverage using the service messages.
Thanks @Johnygmalayil :)
I was looking specifically for an example of the second alternative in which the parameter is being set pointing to the jacoco tool.
Hi Tomer,
it should be as simple as defining a new parameter and adding the value %teamcity.tool.jacoco.DEFAULT% (or a specific one for any version you might be interested in)
The official 2nd workaround is very in-concrete and most probably was for TeamCity developers or for those who has time to gamble and try different approaches to actually make it work. Workaround number 1 is not appropriate for our build process as both TeamCity's code coverages prevent from skipping tests and taking their results from gradle cache (details here: https://teamcity-support.jetbrains.com/hc/en-us/community/posts/360006782380)
Here is missed parts for the 2nd workaround: go to build Parameters -> Add a new parameter -> specify Kind="System property", set Name = system.teamcity.tool.jacoco, set Value =%teamcity.tool.jacoco.0.8.4% (or other version, or %teamcity.tool.jacoco.DEFAULT%).
Don't know how people should guess the name of the parameter and it's Kind from official answers... Maybe, this comment will save somebody's time
P.S. Issue is fixed in 2019.1.4 or above version as stated in https://youtrack.jetbrains.com/issue/TW-61801 (hasn't tested)