[JIRA] (JENKINS-49823) Jacoco Plugin 3.0.1 fails build as basedir now incorrect

88 views
Skip to first unread message

dell.green@ideaworks.co.uk (JIRA)

unread,
Mar 1, 2018, 7:11:02 AM3/1/18
to jenkinsc...@googlegroups.com
Dell Green created an issue
 
Jenkins / Bug JENKINS-49823
Jacoco Plugin 3.0.1 fails build as basedir now incorrect
Issue Type: Bug Bug
Assignee: Ognjen Bubalo
Components: jacoco-plugin
Created: 2018-03-01 12:10
Environment: Jenkins 2.108 and 2.109
Jacoco 3.0.1

System Version: OS X 10.9.5 (13F1911)
Kernel Version: Darwin 13.4.0

java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

Labels: build regression
Priority: Blocker Blocker
Reporter: Dell Green

All builds under jacoco plugin 2.2.1 work fine, as soon as i update to 3.0.1 all jobs with jenkins  jacoco plugin start failing.

I can see now that the 3.0.1 plugin seems to expect the classes to be in build/${BUILD_NUMBER}/jacoco/classes

whereas my jacoco build folder is set to build/jacoco/

If i downgrade back to version 2.2.1 it all works again

 

 

 
Recording test results
[JaCoCo plugin] Collecting JaCoCo coverage data...
[JaCoCo plugin] build/jacoco/*.exec;build/classes/main;*/src; locations are configured
[JaCoCo plugin] Number of found exec files for pattern build/jacoco/**.exec: 1
[JaCoCo plugin] Saving matched execfiles: /home/jenkins/Documents/jenkins_workspace/workspace/IwTurnFramework/build/jacoco/test.exec
[JaCoCo plugin] Saving matched class directories for class-pattern: build/classes/main:
[JaCoCo plugin] Saving matched source directories for source-pattern: **/src:
[JaCoCo plugin] - /home/jenkins/Documents/jenkins_workspace/workspace/IwTurnFramework/src 1012 files
[JaCoCo plugin] Loading inclusions files..
[JaCoCo plugin] inclusions: [**/*.class]
[JaCoCo plugin] exclusions: []
ERROR: Build step failed with exception
java.lang.IllegalStateException: basedir /Volumes/jenkins/Jenkins/Home/jobs/IwTurnFramework/builds/512/jacoco/classes does not exist
at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:281)
at org.codehaus.plexus.util.FileUtils.getFileAndDirectoryNames(FileUtils.java:1940)
at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1868)
at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1850)
at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1825)
at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1808)
at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:124)
Caused: java.lang.RuntimeException: While reading class directory: /Volumes/jenkins/Jenkins/Home/jobs/IwTurnFramework/builds/512/jacoco/classes
at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:131)
at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:137)
at hudson.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:110)
at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:339)
at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:326)
at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:631)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1752)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Record JaCoCo coverage report' marked build as failure

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

dominik.stadler@gmx.at (JIRA)

unread,
Mar 3, 2018, 12:27:03 PM3/3/18
to jenkinsc...@googlegroups.com
centic updated an issue
Change By: centic
Comment: This is the location where Jenkins stores it's build-information, not the build-directory of your project. These files are stored by the plugin itself, so this indicates that you try to open builds where the build-information was not written by the plugin correctly. Are you sure the exact same build works with the older version?

dominik.stadler@gmx.at (JIRA)

unread,
Mar 3, 2018, 12:27:03 PM3/3/18
to jenkinsc...@googlegroups.com

This is the location where Jenkins stores it's build-information, not the build-directory of your project. These files are stored by the plugin itself, so this indicates that you try to open builds where the build-information was not written by the plugin correctly. Are you sure the exact same build works with the older version?

Add Comment Add Comment
 

dominik.stadler@gmx.at (JIRA)

unread,
Mar 3, 2018, 12:36:02 PM3/3/18
to jenkinsc...@googlegroups.com
centic commented on Bug JENKINS-49823

I cannot reproduce this, the directory is used by the plugin to store information about the current Jenkins build, so it is not meant to be pointing to your project's build-directory, but rather into the area that Jenkins uses for build-info.

It seems the problem is that the directory is not existing for you, while it usually always exists at that point.

One problem could be, that you do not have any matching classes-directory based on your config, also the output above indicates that no files were found under "build/classes/main".

dell.green@ideaworks.co.uk (JIRA)

unread,
Mar 3, 2018, 1:57:01 PM3/3/18
to jenkinsc...@googlegroups.com

Ok, yep found the problem, back in August we upgraded jobs from gradle 3 to gradle 4 which automatically changed the classes path from 'build/classes/main' to 'build/classes/java/main'. Nobody noticed as jacoco plugin 2.2.1 didn't fail the build but completed with success. So with jacoco 3.0.1 now failing the build,  I change my initial assessment to this being a welcome feature not a bug. Do you want me to close the ticket?

dominik.stadler@gmx.at (JIRA)

unread,
Mar 3, 2018, 4:30:02 PM3/3/18
to jenkinsc...@googlegroups.com
centic commented on Bug JENKINS-49823

I think the error message is borked and should be improved, so let's keep it open, anybody up for a PR? Should not be too hard to check this upfront and fail more obviously.

pyrocks@gmail.com (JIRA)

unread,
Apr 23, 2018, 2:53:02 PM4/23/18
to jenkinsc...@googlegroups.com
Mor L commented on Bug JENKINS-49823

Hi,

For me this is actually a major problem - I have a generic flow which "suits-all" - some repositories produce jacoco reports while others don't - but I always call the jacoco step . In previous versions of the plugin this found nothing and the job continued properly. with the new plugin version my builds started to fail due to the above mentioned error - so I'm going to downgrade it.

I would expect at least an option to not fail the build if classes/exec files are not found - same as exists for the Junit and TestNG plugins.

pyrocks@gmail.com (JIRA)

unread,
Apr 23, 2018, 2:54:02 PM4/23/18
to jenkinsc...@googlegroups.com
Mor L edited a comment on Bug JENKINS-49823
Hi,

For me this is actually a major problem - I have a generic flow which "suits-all" - some repositories produce jacoco reports while others don't - but I always call the jacoco step . In previous versions of the plugin this found nothing and the job continued properly. with the new plugin version my builds started to fail due to the above mentioned error - so I'm going to downgrade it.

I would expect at least an option to not fail the build if classes/exec files are not found - same as exists for the Junit and TestNG plugins. If needed I can open a new ticket for this request.

dominik.stadler@gmx.at (JIRA)

unread,
Apr 25, 2018, 2:00:03 PM4/25/18
to jenkinsc...@googlegroups.com
centic commented on Bug JENKINS-49823

You are welcome to send a PR for this, the code and the change is not complicated, the plugin is just short on active maintainers...

michaelkotten@gmail.com (JIRA)

unread,
Sep 10, 2018, 3:36:02 AM9/10/18
to jenkinsc...@googlegroups.com
Michael Kotten started work on Bug JENKINS-49823
 
Change By: Michael Kotten
Status: Open In Progress
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

michaelkotten@gmail.com (JIRA)

unread,
Sep 10, 2018, 3:37:02 AM9/10/18
to jenkinsc...@googlegroups.com

michaelkotten@gmail.com (JIRA)

unread,
Sep 10, 2018, 3:37:03 AM9/10/18
to jenkinsc...@googlegroups.com
Change By: Michael Kotten
Status: In Progress Fixed but Unreleased
Resolution: Fixed

michaelkotten@gmail.com (JIRA)

unread,
Sep 13, 2018, 5:44:02 AM9/13/18
to jenkinsc...@googlegroups.com

michaelkotten@gmail.com (JIRA)

unread,
Sep 13, 2018, 5:46:02 AM9/13/18
to jenkinsc...@googlegroups.com

dominik.stadler@gmx.at (JIRA)

unread,
Sep 19, 2018, 4:24:03 PM9/19/18
to jenkinsc...@googlegroups.com
centic updated Bug JENKINS-49823
 

Change is merged to master now, will be released as part of 3.0.2

Change By: centic
Status: Reopened Fixed but Unreleased
Assignee: Ognjen Bubalo centic

dominik.stadler@gmx.at (JIRA)

unread,
Sep 19, 2018, 4:25:02 PM9/19/18
to jenkinsc...@googlegroups.com
centic edited a comment on Bug JENKINS-49823
 
Re: Jacoco Plugin 3.0.1 fails build as basedir now incorrect
Change is merged to master now, will be released as part of 3.0. 2 3

alan@czajkowski.ca (JIRA)

unread,
Oct 16, 2018, 3:45:02 PM10/16/18
to jenkinsc...@googlegroups.com

it's been a month, when will the next release happen that incorporates this fix?

dominik.stadler@gmx.at (JIRA)

unread,
Nov 4, 2018, 6:27:02 AM11/4/18
to jenkinsc...@googlegroups.com
 

This is available now with release 3.0.4

Change By: centic
Status: Fixed but Unreleased Resolved
Released As: 3.0.4
Reply all
Reply to author
Forward
0 new messages