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

Cobertura configuration inconsistent when using CVS

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: cobertura-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      I was having a problem with the cobertura plugin in Hudson so I did some digging
      through the code. I found that when using CVS the search path is relative to the
      first module. Issue 916 discusses this, but it looks like the implemented hack
      only supports subversion and not CVS:

      197 if (project.getScm() instanceof SubversionSCM)

      { 198 // hack of the first kind 199 SubversionSCM scm = SubversionSCM.class.cast(project.getScm()); 200 multipleModuleRoots = scm.getLocations().length > 1; 201 }

      else

      { 202 multipleModuleRoots = false; 203 }

      I could work around this if the includes supported '..', but as issue 916 points
      out, that doesn't work either. So I've worked around it by copying the
      coverage.xml file to the first module in my Job config, but others may have the
      same problem.

      The SCM interface now supports getting the root module, but that returns the
      first module in the CVS implementation. The documentation on the Cobertura
      plugin describes how SVN works with multiple modules, but it isn't clear about
      CVS (which also supports multiple modules).

      Maybe the right solution would be to apply the search path to each module
      defined in order until a match is found or if there are multiple modules
      (regardless of the SCM used), switch to using the workspace as the root.

        Attachments

          Activity

          Hide
          davidmc24 davidmc24 added a comment -

          I'll work on this issue. It makes sense that the behavior should be consistent across all SCMs that support
          multiple modules, rather than treating Subversion differently. Thus, I'm planning on making it such that if
          the SCM says that there are multiple module roots, the default base directory will be the workspace.

          Also, note that there is now an enhancement ticket (3862) for the ability to configure where the base
          directory should be, to support cases where the default value isn't what the user needs.

          Show
          davidmc24 davidmc24 added a comment - I'll work on this issue. It makes sense that the behavior should be consistent across all SCMs that support multiple modules, rather than treating Subversion differently. Thus, I'm planning on making it such that if the SCM says that there are multiple module roots, the default base directory will be the workspace. Also, note that there is now an enhancement ticket (3862) for the ability to configure where the base directory should be, to support cases where the default value isn't what the user needs.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : davidmc24
          Path:
          trunk/hudson/plugins/cobertura/pom.xml
          trunk/hudson/plugins/cobertura/src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java
          trunk/hudson/plugins/cobertura/src/main/resources/hudson/plugins/cobertura/CoberturaPublisher/config.jelly
          http://fisheye4.cenqua.com/changelog/hudson/?cs=19514
          Log:
          Removed Cobertura plugin's dependency on Subversion.
          [FIXED JENKINS-1323] Now the Cobertura plugin will treat all multi-module SCMs equally. If multiple modules are configured, the coverage XML pattern will be resolved relative to the workspace, as opposed to the module root. Previously, this behavior was hardcoded to only apply to Subversion.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : davidmc24 Path: trunk/hudson/plugins/cobertura/pom.xml trunk/hudson/plugins/cobertura/src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java trunk/hudson/plugins/cobertura/src/main/resources/hudson/plugins/cobertura/CoberturaPublisher/config.jelly http://fisheye4.cenqua.com/changelog/hudson/?cs=19514 Log: Removed Cobertura plugin's dependency on Subversion. [FIXED JENKINS-1323] Now the Cobertura plugin will treat all multi-module SCMs equally. If multiple modules are configured, the coverage XML pattern will be resolved relative to the workspace, as opposed to the module root. Previously, this behavior was hardcoded to only apply to Subversion.
          Hide
          davidmc24 davidmc24 added a comment -

          Included in Cobertura plugin version 0.8.9

          Show
          davidmc24 davidmc24 added a comment - Included in Cobertura plugin version 0.8.9

            People

            • Assignee:
              davidmc24 davidmc24
              Reporter:
              mpilone mpilone
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: