Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.7
    • Labels:
      None
    • Environment:
      Windows XP, maven 2.0.8
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      5

      Description

      In my project, I have both unit tests ("test" phase) and integration tests ("integration-test" phase).
      So far I could manage configuring maven-surefire-plugin and maven-surefire-report-plugin to execute both tests correctly and also generate 2 different reports.
      Then I have added cobertura-maven-plugin to the reporting in order to get coverage but unfortunately only unit tests have their coverage reported (I know it because I have some classes which are only integration tested but are reported as 0% covered).
      After trying to find information on the mailing lists, on the web and other existing resources, I could not find any hint on how to make this work.
      It looks like cobertura-maven-plugin, by its current design, will never run integration-test to collect coverage, it seems to stop at the "test" phase.

      Thus whenever a POM project has integration tests and uses cobertura-maven-plugin for coverage report, the generated reports are wrong, which is very misleading.

      Actually, I was surprised not to find this issue already in JIRA.

      Is there a chance this gets fixed soon? Or is there a usable workaround for this problem (besides switching to clover which I am not sure it would work better ) Did someone succeed in patching cobertura-maven-plugin to get the correct behavior?

        Issue Links

          Activity

          Hide
          Dennis Lundberg added a comment -

          Digging some more into the code it looks like we will also need a CoberturaIntegrationTestCheckMojo that extends the CoberturaCheckMojo, but with a different execution phase.

          The clean, dump-datafile and instrument goals does not appear to require any changes.

          Show
          Dennis Lundberg added a comment - Digging some more into the code it looks like we will also need a CoberturaIntegrationTestCheckMojo that extends the CoberturaCheckMojo , but with a different execution phase. The clean , dump-datafile and instrument goals does not appear to require any changes.
          Hide
          Dennis Lundberg added a comment -

          Two new goals were added in r20181:

          • cobertura-integration-test (based on the patch by Stevo Slavic)
          • check-integration-test

          They extend the cobertura and check goals, but change the execution phase so that integration tests are also included in the Cobertura analysis.

          I will push new SNAPSHOTs to the snapshot repo a little later, so that people can test it out.

          Show
          Dennis Lundberg added a comment - Two new goals were added in r20181: cobertura-integration-test (based on the patch by Stevo Slavic) check-integration-test They extend the cobertura and check goals, but change the execution phase so that integration tests are also included in the Cobertura analysis. I will push new SNAPSHOTs to the snapshot repo a little later, so that people can test it out.
          Hide
          Dennis Lundberg added a comment -

          A SNAPSHOT has now been deployed to
          https://nexus.codehaus.org/content/repositories/snapshots/

          Please try it out!

          Show
          Dennis Lundberg added a comment - A SNAPSHOT has now been deployed to https://nexus.codehaus.org/content/repositories/snapshots/ Please try it out!
          Hide
          Maciek Siemczyk added a comment -

          For some reason I can't add vote for this, but can you please release a version with this fix?

          Show
          Maciek Siemczyk added a comment - For some reason I can't add vote for this, but can you please release a version with this fix?
          Hide
          Martin Kutter added a comment -

          Failsafe-Support works for me using the cobertura:cobertura-integration-test target in 2.7-SNAPSHOT.

          I'd also greately appreciate a release Version

          Show
          Martin Kutter added a comment - Failsafe-Support works for me using the cobertura:cobertura-integration-test target in 2.7-SNAPSHOT. I'd also greately appreciate a release Version

            People

            • Assignee:
              Dennis Lundberg
              Reporter:
              Jean-Francois Poilpret

              Dates

              • Created:
                Updated:
                Resolved: