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

Jacoco plugin broke with InfluxDB Plugin integration

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Blocker Blocker
    • influxdb-plugin
    • Jenkins version: 2.107.1
      Jacoco Plugin : 3.01
      InfluxDB Plugin 1.14

      InfluxDB Plugin is not working publishing Jacoco reports. jacoco_data table is also not created. Influx db plugin says it published successfully

      Using Pipeline

      step([$class: 'InfluxDbPublisher', customData: null, customDataMap: null, customPrefix: null, target: 'jacocotarget'])
      

      Console Output

      [Pipeline] jacoco
      [JaCoCo plugin] Collecting JaCoCo coverage data...
      [JaCoCo plugin] **/target/jacoco.exec;**/classes;**/src/main/java; locations are configured
      [JaCoCo plugin] Number of found exec files for pattern **/target/jacoco.exec: 1
      [JaCoCo plugin] Saving matched execfiles:  /var/jenkins_home/workspace/mypipeline/service-1/target/jacoco.exec
      [JaCoCo plugin] Saving matched class directories for class-pattern: **/classes: 
      [JaCoCo plugin]  - /var/jenkins_home/workspace/mypipeline/service-1/target/classes 13 files
      [JaCoCo plugin] Saving matched source directories for source-pattern: **/src/main/java: 
      [JaCoCo plugin] - /var/jenkins_home/workspace/mypipeline/service-1/src/main/java 13 files
      [JaCoCo plugin] - /var/jenkins_home/workspace/mypipeline/service-2/src/main/java 13 files
      [JaCoCo plugin] - /var/jenkins_home/workspace/mypipeline/service-3/src/main/java 13 files
      [JaCoCo plugin] Loading inclusions files..
      [JaCoCo plugin] inclusions: []
      [JaCoCo plugin] exclusions: []
      [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0]
      [JaCoCo plugin] Publishing the results..
      [JaCoCo plugin] Loading packages..
      [JaCoCo plugin] Done.
      [JaCoCo plugin] Overall coverage: class: 77, method: 55, line: 60, branch: 40, instruction: 71
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (Report)
      [Pipeline] step
      ...
      ...
      ...
      [InfluxDB Plugin] Publishing data to: [url=http://172.17.0.3:8086, description=jacocotarget, username=root, password=*****, database=grafana]
      [InfluxDB Plugin] Completed.
      [InfluxDB Plugin] Publishing data to: [url=http://172.17.0.3:8086, description=jacocotarget, username=root, password=*****, database=grafana]
      [InfluxDB Plugin] Completed.
      

      It creates jenkins_data table under grafana database but  will not create jacoco_data

      I have downgraded to Jacoco 2.3- SNAPSHOT plugin and it worked with this plugin.

      [InfluxDB Plugin] Publishing data to: [url=http://172.17.0.3:8086, description=jacocotarget, username=root, password=*****, database=grafana]
      [InfluxDB Plugin] Jacoco data found. Writing to InfluxDB...
      [InfluxDB Plugin] Completed.

       

      Docs also need to be updated to give some examples for each of the configuration. It's very hard to debug with little documentation around this.

       

          [JENKINS-50388] Jacoco plugin broke with InfluxDB Plugin integration

          Aleksi Simell added a comment -

          Looks like there is a breaking change between Jacoco plugin versions 2 and 3. I will add support for the latest Jacoco plugin version.

          Aleksi Simell added a comment - Looks like there is a breaking change between Jacoco plugin versions 2 and 3. I will add support for the latest Jacoco plugin version.

          Aleksi Simell added a comment - - edited

          I tried to build with the latest Jacoco plugin both a pipeline job and non-pipeline and they both worked just fine. Can you try again with a newer version of InfluxDb plugin?

           

           

          node { 
            try { 
              stage('Build') { 
                withMaven(maven:'Maven3') {
                  sh 'mvn clean package' 
                } 
                jacoco classPattern: '**/target/classes', execPattern: '**/target/coverage-results/**.exec' 
              } 
              stage('Report') {
                def myData = [:] 
                myData['customdata'] = '1'
                step([$class: 'InfluxDbPublisher', customData: myData, customDataMap: null, customPrefix: 'prefix', target: 'Target 1'])
               } 
            } catch (Exception e) { 
              currentBuild.result = "FAILURE" 
              step([$class: 'InfluxDbPublisher', customData: null, customDataMap: null, customPrefix: null, target: 'Target 1']) 
            }
          }
          

           

          This is the pipeline script I used to test this issue.

          Aleksi Simell added a comment - - edited I tried to build with the latest Jacoco plugin both a pipeline job and non-pipeline and they both worked just fine. Can you try again with a newer version of InfluxDb plugin?     node { try { stage( 'Build' ) { withMaven(maven: 'Maven3' ) { sh 'mvn clean package ' } jacoco classPattern: '**/target/classes' , execPattern: '**/target/coverage-results/**.exec' } stage( 'Report' ) { def myData = [:] myData[ 'customdata' ] = '1' step([$class: 'InfluxDbPublisher' , customData: myData, customDataMap: null , customPrefix: 'prefix' , target: 'Target 1' ]) } } catch (Exception e) { currentBuild.result = "FAILURE" step([$class: 'InfluxDbPublisher' , customData: null , customDataMap: null , customPrefix: null , target: 'Target 1' ]) } }   This is the pipeline script I used to test this issue.

          Aleksi Simell added a comment -

          saisantoshi76 Is this still an issue?

          Aleksi Simell added a comment - saisantoshi76 Is this still an issue?

          Aleksi Simell added a comment -

          I cannot reproduce this issue with the newest version of InfluxDB plugin, closing issue. Please open if still an issue.

          Aleksi Simell added a comment - I cannot reproduce this issue with the newest version of InfluxDB plugin, closing issue. Please open if still an issue.

            aleksisimell Aleksi Simell
            saisantoshi76 sai santoshi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: