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
          Stevo Slavic added a comment -

          Issue created in March 2008, patch you're commenting was added in 2009, and now is almost 2015....
          I'm not sure if issue is relevant any more at all. I'm not using cobertura anymore, partially because it took so long to get attention to this issue; jacoco works for me.
          So, AFAIAC you can ignore patch. Removed my vote.

          Show
          Stevo Slavic added a comment - Issue created in March 2008, patch you're commenting was added in 2009, and now is almost 2015.... I'm not sure if issue is relevant any more at all. I'm not using cobertura anymore, partially because it took so long to get attention to this issue; jacoco works for me. So, AFAIAC you can ignore patch. Removed my vote.
          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?

            People

            • Assignee:
              Dennis Lundberg
              Reporter:
              Jean-Francois Poilpret
            • Votes:
              67 Vote for this issue
              Watchers:
              51 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: