<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:bookman old style,new york,times,serif;font-size:12pt"><div>I installed the most recent coverage.py on Windows Vista x64 with Hudson 1.325. It ran the coverage report and parse the output with the Cobertura plugin. My tests are quite simple (mostly tiny little unit tests, testing simple code on the other side as well).<br><br>I was already using nosetests for test discovery. That required a few changes to make it work (either inside or outside Hudson).<br><br>Before coverage, I ran the tests with the command:<br><br> nosetests --with-xunit<br><br>After installing coverage, I ran the same tests with the command:<br><br> coverage run c:\Python26\Scripts\nosetests-script.py<br> coverage xml<br><br>With those commands, I'm able to see percentage coverage results. Unfortunately,
the Cobertura plugin will not show me the source of the files. In the coverage.xml file, the file name is listed as "test_add_atom.py", while the full path to the source file is "tests\libpdm\test_add_atom.py". I have a suspicion that there is a way to tell the Cobertura plugin where to find my source files, but since this was the first time I'd ever used the Cobertura plugin for Hudson, I was glad to see it work at all.<br><br>Since I already have a script that performs repairs in nosetest.xml (the --with-xunit output file), I think I can easily extend that script to perform repairs in the coverage.xml file.<br><br>Thanks for a great tool!<br>Mark Waite<br></div><div style="font-family: bookman old style,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Ned Batchelder
<ned@nedbatchelder.com><br><b><span style="font-weight: bold;">To:</span></b> Sebastien Douche <sdouche@gmail.com><br><b><span style="font-weight: bold;">Cc:</span></b> tip <testing-in-python@lists.idyll.org><br><b><span style="font-weight: bold;">Sent:</span></b> Monday, September 28, 2009 7:13:01 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [TIP] Coverage.py 3.1 beta 1: Python 3.x and Cobertura output<br></font><br>
<title></title>
Sebastien Douche wrote:
<blockquote type="cite">
<pre>On Sun, Sep 27, 2009 at 17:37, Ned Batchelder <a rel="nofollow" class="moz-txt-link-rfc2396E" ymailto="mailto:ned@nedbatchelder.com" target="_blank" href="mailto:ned@nedbatchelder.com"><ned@nedbatchelder.com></a> wrote:<br><br>Hi Ned,<br><br> </pre>
<blockquote type="cite">
<pre>I'm especially interested in finding people using Hudson or Sonar with<br>Python,<br> </pre>
</blockquote>
<pre>Is it possible to use Sonar with Python? As far I know, It's a "<br>graphical frontend" for misc Java tools (code coverage, cc...). Btw,<br>I'm also interested :).<br> </pre>
</blockquote>
Honestly, I don't know. That's my difficulty here: Cobertura is
integrated into a few Java toolsets, which I have no experience with,
and even trying to follow the tutorials takes me into unfamiliar
territory. Hudson and Sonar seem to be two that are popular. I'm
hoping this list has some knowledgeable practitioners who can help a
poor n00b like me...<br>
<br>
--Ned.<br>
<a rel="nofollow" class="moz-txt-link-freetext" target="_blank" href="http://nedbatchelder.com">http://nedbatchelder.com</a><br>
</div></div></div></body></html>