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

Add option to merge nodes from different modules

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Postponed
    • Icon: Minor Minor
    • coverage-plugin
    • None

      We've switched from SonarQube to Jenkins Coverage Plugin for reporting our integration test coverage.
      Reason was that waiting for our integration tests to finish just to be able to start the static code analysis was streching out build times, and therefor feedback loops to the developers, way too much.

      However something I just discovered today was unintuitive for me and maybe there's a workaround or feature to mitigate that.

      I basically always have multimodule projects:

      project
      | - subA
        | - src
          | - main
      | - subB
        | - src
          | - main 
          | - test
          | - integrationTest 

      When running the build each project will produce unit and integration test coverage files (in their own directory structure) with jacoco in the xml format and we gather them in the Jenkins file like this:

       discoverReferenceBuild()
                                      recordCoverage(tools: [[parser: 'JACOCO', pattern: '**/reports/jacoco/**/*.xml']],
                                              sourceCodeRetention: 'LAST_BUILD',
                                              sourceDirectories: [[path: 'glob:**/src/main/java'],[path: 'glob:**/gen/main/java']])
      

      My expectation (and this is how I remember SonarQube did it) was that the coverage data is merged from all individual files, no matter which type of test (unit or integration) or subproject was creating it.
      So even if a Test implemented in subB the coverage of the dependend code to subA is still counting.

      What I observed is that the Coverage Plugin seems to assign each coverage file to a module and does the same for the source file. Now the coverage of a source file is only derived from the coverage file located in the same module.

      If for some reason a feature in subA is not tested by a test in subA (did I say we're having legacy code?) but it's used by a test implemented in subB (maybe it's a actual implementation there that does embedded testing in a broader business process) the coverage currently won't show up in the Jenkins UI.

      That is actually an acceptence problem for me and I was hoping that either such a feature would be easy to implement or I just missed a switch that already allows me to treat the whole project as one single module.

            drulli Ulli Hafner
            dageissl Daniel Geißler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: