Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45535

non standard jacoco usage breaks the build / standard dev flow

      For some reason (not documented in the POM) blue ocean uses a the non preffered way of invoking jacoco for code coverage.

      http://www.eclemma.org/jacoco/trunk/doc/instrument-mojo.html

      Performs offline instrumentation. Note that after execution of test you must restore original classes with help of "restore-instrumented-classes" goal.

      The issue with this is that classess are not restored until prepare-package which is not called when running mvn test

      Thus when you run mvn test followed by mvn test you end up with a failure as jacoco tries to instrument already instrumented classes and bombs out. Workaround it to run mvn clean test but this adds to the turnaround time to check tests.

      Note you can just enable jacoco with mvn -Penable-jacoco with recent jenkins plugin poms and it does the right thing...

      ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.7.9:instrument (default-instrument) on project blueocean-git-pipeline: Unable to instrument file.: Error while instrumenting class /mnt/c/workarea/source/github/jenkinsci/blueocean-plugin/blueocean-git-pipeline/target/classes/io/jenkins/blueocean/blueocean_git_pipeline/GitPipelineCreateRequest.class. Class io/jenkins/blueocean/blueocean_git_pipeline/GitPipelineCreateRequest is already instrumented. -> [Help 1]
      

          [JENKINS-45535] non standard jacoco usage breaks the build / standard dev flow

          James Nord created issue -
          James Nord made changes -
          Attachment New: sadpanda.txt [ 38878 ]
          James Dumay made changes -
          Sprint New: Blue Ocean 1.3 [ 296 ]
          Assignee New: Vivek Pandey [ vivek ]
          James Dumay made changes -
          Labels New: technical-debt
          James Dumay made changes -
          Epic Link New: JENKINS-35759 [ 171771 ]
          James Dumay made changes -
          Sprint Original: Blue Ocean 1.3-beta-2 [ 296 ] New: Blue Ocean 1.4 [ 311 ]
          James Dumay made changes -
          Rank New: Ranked higher
          Michael Neale made changes -
          Resolution New: Won't Fix [ 2 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          James Dumay made changes -
          Sprint Original: Blue Ocean 1.5 - candidates [ 311 ]
          James Dumay made changes -
          Rank New: Ranked higher

            vivek Vivek Pandey
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: