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

Coverage plugin fails with two reports for the same module

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • coverage-plugin
    • None
    • Jenkins 2.414.3 with coverage plugin 1.3.0

      When using the recordCoverage step I get the following error:

      Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 8b0b4589-7bb1-47cb-838c-32068447f61c
      java.lang.IllegalArgumentException: There is already a child [MODULE] Authentication Endpoints <8> [] with the name Authentication Endpoints in [CONTAINER] Container <1, LINE: 10.73% (90/839)>
      at edu.hm.hafner.coverage.Node.addChild(Node.java:165)
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
      at edu.hm.hafner.coverage.Node.addAllChildren(Node.java:198)
      at edu.hm.hafner.coverage.Node.merge(Node.java:610)
      at io.jenkins.plugins.coverage.metrics.steps.CoverageRecorder.perform(CoverageRecorder.java:412)
      at io.jenkins.plugins.coverage.metrics.steps.CoverageRecorder.perform(CoverageRecorder.java:397)
      

      I guess this is related to that I have two separate jacoco.xml files per maven module, one for unit tests and one for integration tests. As it is the convention in maven.

      But this leads to multiple same named modules, one with the unit tests as content, and one with the integration tests as content.

      I could rename the integration tests in maven, but I think it should not crash on the default maven configuration everyone uses.

       

      recordCoverage(
                failOnError: false,
                sourceCodeRetention: 'NEVER',
                tools: [
                    [parser: 'JACOCO', pattern: '**/target/site/jacoco-ut/jacoco.xml,**/target/site/jacoco-it/jacoco.xml'],
                    [parser: 'COBERTURA', pattern: '**/target/coverage-reports/cobertura-coverage.xml']])

            drulli Ulli Hafner
            reitzmichnicht Michael Düsterhus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: