Issue Details (XML | Word | Printable)

Key: HUDSON-1323
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: davidmc24
Reporter: mpilone
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hudson

Cobertura configuration inconsistent when using CVS

Created: 20/Feb/08 11:05 AM   Updated: 07/Jul/09 09:21 PM   Resolved: 07/Jul/09 06:38 PM
Component/s: cobertura
Affects Version/s: current
Fix Version/s: None

Environment: Platform: All, OS: All


 Description  « Hide

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.



Sort Order: Ascending order - Click to sort in descending order
davidmc24 added a comment - 10/Jun/09 07:03 PM

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.


scm_issue_link added a comment - 07/Jul/09 06:38 PM

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 HUDSON-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.


davidmc24 added a comment - 07/Jul/09 09:21 PM

Included in Cobertura plugin version 0.8.9