[
https://issues.jenkins-ci.org/browse/JENKINS-12203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=158931#comment-158931
]
Rob Guttman commented on JENKINS-12203:
---------------------------------------
I have the same problem but no workaround appears to work. I've even tried
several described here:
http://stackoverflow.com/questions/2285672/hudson-source-code-is-unavailable
My setup:
* coverage job is triggered by a successful test job and executed on a remote
node
* coverage.xml generated via django-nose and nosexcover plugin
* no <sources> element is included - so inserted using sed but did not fix
* filename attributes are relative paths - so changed to absolute paths using
sed but did not fix
Would really like to get source code view working! Thanks!
> Cobertura plugin cannot show file level reports
> -----------------------------------------------
>
> Key: JENKINS-12203
> URL: https://issues.jenkins-ci.org/browse/JENKINS-12203
> Project: Jenkins
> Issue Type: Bug
> Components: cobertura
> Environment: * RedHat Linux 2.6
> * Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
> * Jenkins 1.444
> * Jenkins Cobertura Plugin 1.3
> Reporter: Dave Ohlsson
> Assignee: stephenconnolly
> Labels: plugin
>
> We have a job dedicated to coverage analysis. We use Jenkins Cobertura plugin
> in this job.
> The workspace directory of that job looks like this:
> <job_directory>/workspace
> <job_directory>/workspace/source
> <job_directory>/workspace/build
> [other subdirectories under workspace]
> We generate coverage.xml with gcovr, in <job_directory>/workspace/build.
> <job_directory>/workspace/build/coverage.xml has the following element:
> <sources>
> <source>
> ../source
> </source>
> </sources>
> which looks correct.
> <job_directory>/workspace/build/coverage.xml refers to source code with
> elements such as:
> <class [...] filename="foo/bar.cc" [...] name="bar_cc">
> which again looks correct.
> When the job runs, it ends with this message:
> Publishing Cobertura coverage report...
> Publishing Cobertura coverage results...
> Finished: SUCCESS
> The statistics seem correct (at least they vary over time), but when looking
> at source code level reports of indivual files, we get:
> Source code is unavailable. Some possible reasons are:
> This is not the most recent build (to save on disk space, this plugin
> only keeps the most recent build's source code).
> Cobertura found the source code but did not provide enough information
> to locate the source code.
> Cobertura could not find the source code, so this plugin has no hope of
> finding it.
> The reason is that <job_directory>/cobertura is empty.
> One workaround we found was to move coverage.xml from
> <job_directory>/workspace/build to <job_directory>/workspace (and changing
> the content of element <source> from ../source to ./source). After doing this
> single change, <job_directory>/cobertura is populated, and source code level
> reports of indivual files work.
> To summarize, there are two problems here:
> 1) Cobertura plugin ends with a success message ("Publishing Cobertura
> coverage results..."), although it fails to copy files to
> <job_directory>/cobertura. This is misleading.
> 2) coverage.xml is not allowed to be in a sibling directory of the source
> directory.
> We may want to have a look at
> https://issues.jenkins-ci.org/browse/JENKINS-11354, which is somewhat related
> to this problem.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira