[JIRA] (JENKINS-13889) Cobertura plugin is not able to find code from python coverage

736 views
Skip to first unread message

cangove@java.net (JIRA)

unread,
May 24, 2012, 12:54:24 AM5/24/12
to jenkinsc...@googlegroups.com
cangove created JENKINS-13889:
---------------------------------

Summary: Cobertura plugin is not able to find code from python coverage
Key: JENKINS-13889
URL: https://issues.jenkins-ci.org/browse/JENKINS-13889
Project: Jenkins
Issue Type: Bug
Components: cobertura
Affects Versions: current
Reporter: cangove
Assignee: stephenconnolly


Our repository has all src code under /src. So when running tests and coverage the coverage.xml file is generated in $WORKSPACE/src. In the job config I specify **/coverage.xml in the location. Th eCobertura plugin finds the coverage report but states:

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


I believe this is due to the fact that coverage.xml records the relative path to the files. As this file is in $WORKSPACE/src I would expect it to find the files in $WORKSPACE/src/<relative path>, but I susepct it's omitting the 'src' directory.

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


s.sogabe@gmail.com (JIRA)

unread,
May 24, 2012, 4:44:27 AM5/24/12
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-13889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163153#comment-163153 ]

sogabe commented on JENKINS-13889:
----------------------------------

would you attach your coverage.xml?



> Cobertura plugin is not able to find code from python coverage
> --------------------------------------------------------------

cangove@java.net (JIRA)

unread,
May 24, 2012, 12:57:25 PM5/24/12
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-13889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

cangove updated JENKINS-13889:
------------------------------

Attachment: coverage.xml

Here is an example of one of our coverage.xml reports. Produced via http://pypi.python.org/pypi/coverage.

> Cobertura plugin is not able to find code from python coverage
> --------------------------------------------------------------
>
> Key: JENKINS-13889
> URL: https://issues.jenkins-ci.org/browse/JENKINS-13889
> Project: Jenkins
> Issue Type: Bug
> Components: cobertura
> Affects Versions: current
> Reporter: cangove
> Assignee: stephenconnolly
> Attachments: coverage.xml

s.sogabe@gmail.com (JIRA)

unread,
May 25, 2012, 8:12:24 AM5/25/12
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-13889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sogabe updated JENKINS-13889:
-----------------------------

Attachment: coverage_by_cobertura.xml

attached coverage.xml which is generated by cobertura.

> Cobertura plugin is not able to find code from python coverage
> --------------------------------------------------------------
>
> Key: JENKINS-13889
> URL: https://issues.jenkins-ci.org/browse/JENKINS-13889
> Project: Jenkins
> Issue Type: Bug
> Components: cobertura
> Affects Versions: current
> Reporter: cangove
> Assignee: stephenconnolly
> Attachments: coverage.xml, coverage_by_cobertura.xml

s.sogabe@gmail.com (JIRA)

unread,
May 25, 2012, 8:18:25 AM5/25/12
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-13889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163189#comment-163189 ]

sogabe commented on JENKINS-13889:
----------------------------------

You can see <sources>/<source> elements in my coverage.xml generated by cobertura.
Cobertura plugin is looking for source code using a value of "sources/source". However your coverage.xml which is generated by coverage.py doesn't have them.

I think coverage.py should fix it.

> Cobertura plugin is not able to find code from python coverage
> --------------------------------------------------------------
>
> Key: JENKINS-13889
> URL: https://issues.jenkins-ci.org/browse/JENKINS-13889
> Project: Jenkins
> Issue Type: Bug
> Components: cobertura
> Affects Versions: current
> Reporter: cangove
> Assignee: stephenconnolly
> Attachments: coverage.xml, coverage_by_cobertura.xml

cangove@java.net (JIRA)

unread,
May 25, 2012, 9:59:25 AM5/25/12
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-13889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163195#comment-163195 ]

cangove commented on JENKINS-13889:
-----------------------------------

Thanks! That makes sense. So I can prep the proper report and possible fix for coverage, do the paths in <sources> need to be absolute or can they be relative to the coverage report?


> Cobertura plugin is not able to find code from python coverage
> --------------------------------------------------------------
>
> Key: JENKINS-13889
> URL: https://issues.jenkins-ci.org/browse/JENKINS-13889
> Project: Jenkins
> Issue Type: Bug
> Components: cobertura
> Affects Versions: current
> Reporter: cangove
> Assignee: stephenconnolly
> Attachments: coverage.xml, coverage_by_cobertura.xml

ich@tessarakt.de (JIRA)

unread,
Jun 11, 2012, 12:53:18 PM6/11/12
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-13889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163814#comment-163814 ]

Jens Müller commented on JENKINS-13889:
---------------------------------------

Yes. Please provide proper documentation about what kind of paths the plugin expects ...

(I just a thread to the jenkins Google Group about this as well.)

> Cobertura plugin is not able to find code from python coverage
> --------------------------------------------------------------
>
> Key: JENKINS-13889
> URL: https://issues.jenkins-ci.org/browse/JENKINS-13889
> Project: Jenkins
> Issue Type: Bug
> Components: cobertura
> Affects Versions: current
> Reporter: cangove
> Assignee: stephenconnolly
> Attachments: coverage.xml, coverage_by_cobertura.xml

ich@tessarakt.de (JIRA)

unread,
Jun 11, 2012, 2:41:17 PM6/11/12
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-13889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163816#comment-163816 ]

Jens Müller commented on JENKINS-13889:
---------------------------------------

And I should add that I use an absolute path for the <source> element and paths relative to it for the filename attribute, as in the attached example produced by Cobertura. And still I get the error message about missing source code.

> Cobertura plugin is not able to find code from python coverage
> --------------------------------------------------------------
>
> Key: JENKINS-13889
> URL: https://issues.jenkins-ci.org/browse/JENKINS-13889
> Project: Jenkins
> Issue Type: Bug
> Components: cobertura
> Affects Versions: current
> Reporter: cangove
> Assignee: stephenconnolly
> Attachments: coverage.xml, coverage_by_cobertura.xml

s.sogabe@gmail.com (JIRA)

unread,
Jun 16, 2012, 11:26:23 AM6/16/12
to jenkinsc...@googlegroups.com
sogabe commented on Bug JENKINS-13889

See coverage_by_cobertura.xml.
proper documentation? I don't know where it is.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
Reply all
Reply to author
Forward
0 new messages