Re: [Zope-dev] zope.testing coverage support
On Sunday 17 January 2010, Martin Aspeli wrote: > Stephan Richter wrote: > > On Sunday 17 January 2010, Martin Aspeli wrote: > >> I'm using zope.testing-3.7.7, which is what comes with Zope 2.12. > > > > Here is what I have in effectively any package: > > > > [coverage-test] > > recipe = zc.recipe.testrunner > > eggs = pkg [test] > > defaults = ['--coverage', '../../coverage'] > > > > [coverage-report] > > recipe = zc.recipe.egg > > eggs = z3c.coverage > > scripts = coverage=coverage-report > > arguments = ('coverage', 'coverage/report') > > Thanks! > > As a matter of constructive criticism, it would be useful to have > something like this on the z3c.caching PyPI page. Right now, there is no > way that I can see to understand how the package is meant to be used > from that page, or any of the other documentation. > > It'd also be useful to note that enscript must be installed for syntax > highlighting to work. I only figured that out by reading the source. Yeah, I agree. I talked to Ned (the author of coverage.py) last week and he told me that the newer versions of coverage.py do HTML reporting including syntax highlighting. I wonder whether we should simply pull in his latest code. Regards, Stephan -- Entrepreneur and Software Geek Google me. "Zope Stephan Richter" ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.testing coverage support
Christian Theune wrote: >> As a matter of constructive criticism, it would be useful to have >> something like this on the z3c.caching PyPI page. Right now, there is no > > That's a typo, right? D'oh; z3c.coverage, I meant. >> way that I can see to understand how the package is meant to be used >> from that page, or any of the other documentation. >> >> It'd also be useful to note that enscript must be installed for syntax >> highlighting to work. I only figured that out by reading the source. > > Also, if this functionality is useful, I'd rather see this folded into > the mainstream runner. +1 > At some point, the test runner recipe could also be provided by the > zope.testing package itself IMHO. +1 Martin -- Author of `Professional Plone Development`, a book for developers who want to work with Plone. See http://martinaspeli.net/plone-book ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.testing coverage support
On 01/18/2010 05:34 AM, Martin Aspeli wrote: > Stephan Richter wrote: >> On Sunday 17 January 2010, Martin Aspeli wrote: >>> I'm using zope.testing-3.7.7, which is what comes with Zope 2.12. >> >> Here is what I have in effectively any package: >> >> [coverage-test] >> recipe = zc.recipe.testrunner >> eggs = pkg [test] >> defaults = ['--coverage', '../../coverage'] >> >> [coverage-report] >> recipe = zc.recipe.egg >> eggs = z3c.coverage >> scripts = coverage=coverage-report >> arguments = ('coverage', 'coverage/report') > > Thanks! > > As a matter of constructive criticism, it would be useful to have > something like this on the z3c.caching PyPI page. Right now, there is no That's a typo, right? > way that I can see to understand how the package is meant to be used > from that page, or any of the other documentation. > > It'd also be useful to note that enscript must be installed for syntax > highlighting to work. I only figured that out by reading the source. Also, if this functionality is useful, I'd rather see this folded into the mainstream runner. At some point, the test runner recipe could also be provided by the zope.testing package itself IMHO. Christian -- Christian Theune · c...@gocept.com gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1 Zope and Plone consulting and development ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.testing coverage support
On 01/17/2010 04:34 PM, Martin Aspeli wrote: > Attila Oláh wrote: > >> You can get the same result as with `pwd` by using --coverage=../../coverage > > D'oh! The current path is parts/test (via zc.recipe.testrunner). I did > *not* expect that. > > > I think this needs to be documented at least, though I think it would > make more sense if the current directory was, well, the current > directory. :) Suggestion: if one enables coverage reporting, we should print the actual directory where the reports go or alternatively we could print the working directory when the test runner produces output there. Christian -- Christian Theune · c...@gocept.com gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1 Zope and Plone consulting and development ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.testing coverage support
Stephan Richter wrote: > On Sunday 17 January 2010, Martin Aspeli wrote: >> I'm using zope.testing-3.7.7, which is what comes with Zope 2.12. > > Here is what I have in effectively any package: > > [coverage-test] > recipe = zc.recipe.testrunner > eggs = pkg [test] > defaults = ['--coverage', '../../coverage'] > > [coverage-report] > recipe = zc.recipe.egg > eggs = z3c.coverage > scripts = coverage=coverage-report > arguments = ('coverage', 'coverage/report') Thanks! As a matter of constructive criticism, it would be useful to have something like this on the z3c.caching PyPI page. Right now, there is no way that I can see to understand how the package is meant to be used from that page, or any of the other documentation. It'd also be useful to note that enscript must be installed for syntax highlighting to work. I only figured that out by reading the source. Martin -- Author of `Professional Plone Development`, a book for developers who want to work with Plone. See http://martinaspeli.net/plone-book ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.testing coverage support
On Sunday 17 January 2010, Martin Aspeli wrote: > I'm using zope.testing-3.7.7, which is what comes with Zope 2.12. Here is what I have in effectively any package: [coverage-test] recipe = zc.recipe.testrunner eggs = pkg [test] defaults = ['--coverage', '../../coverage'] [coverage-report] recipe = zc.recipe.egg eggs = z3c.coverage scripts = coverage=coverage-report arguments = ('coverage', 'coverage/report') Regards, Stephan -- Entrepreneur and Software Geek Google me. "Zope Stephan Richter" ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.testing coverage support
Hi. On Sun, Jan 17, 2010 at 4:08 PM, Martin Aspeli wrote: > A couple of questions about zope.testing's --coverage option: I think the standard option is to use something like this buildout snippet: [coverage-test] recipe = zc.recipe.testrunner eggs = ${buildout:eggs} defaults = ['--coverage', '../../coverage'] [coverage-report] recipe = zc.recipe.egg eggs = z3c.coverage scripts = coverage=coverage-report arguments = ('coverage', 'report') And then run: bin/coverage-test bin/coverage-report Hanno ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.testing coverage support
Attila Oláh wrote: > You can get the same result as with `pwd` by using --coverage=../../coverage D'oh! The current path is parts/test (via zc.recipe.testrunner). I did *not* expect that. I think this needs to be documented at least, though I think it would make more sense if the current directory was, well, the current directory. :) Martin -- Author of `Professional Plone Development`, a book for developers who want to work with Plone. See http://martinaspeli.net/plone-book ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.testing coverage support
Hi, On Sun, Jan 17, 2010 at 16:08, Martin Aspeli wrote: > Hi, > > A couple of questions about zope.testing's --coverage option: > > 1. When specifying the coverage output directory, I have to specify an > absolute path: > > ./bin/test -s plone.caching --coverage="$(pwd)/coverage" > > works > > ./bin/test -s plone.caching --coverage="coverage" > > does not. Is this intentional? It took me ages to figure out this was > necessary. Relative paths work for me. $ ./bin/test --coverage=coverage # ... $ ls parts/test/coverage/ zope.interface.adapter.cover zope.interface.exceptions.cover zope.interface.tests.test_advice.cover zope.interface.advice.cover zope.interface.interface.cover zope.interface.tests.test_declarations.cover zope.interface.common.__init__.cover zope.interface.ro.cover zope.interface.tests.test_document.cover zope.interface.common.idatetime.cover zope.interface.tests.__init__.cover zope.interface.tests.test_element.cover zope.interface.common.interfaces.cover zope.interface.tests.dummy.cover zope.interface.tests.test_interface.cover zope.interface.common.tests.__init__.cover zope.interface.tests.ifoo.cover zope.interface.tests.test_odd_declarations.cover zope.interface.common.tests.test_idatetime.cover zope.interface.tests.m1.cover zope.interface.tests.test_sorting.cover zope.interface.common.tests.test_import_interfaces.cover zope.interface.tests.m2.cover zope.interface.tests.test_verify.cover zope.interface.declarations.cover zope.interface.tests.odd.cover zope.interface.tests.unitfixtures.cover zope.interface.document.cover zope.interface.tests.test_adapter.cover zope.interface.verify.cover You can get the same result as with `pwd` by using --coverage=../../coverage > 2. Is there anything that can read the coverage output files and > present them with syntax highlighting and highlight problem areas? I > know other tools (like Cobertura) have this. Is there a standard, or is > it a custom format? > > 3. I get coverage reporting for my tests (i.e. it lists coverage of > the tests package). The PyPI page for zope.testing talks about ignoring > tests, but that part of the doctest is not useful as documentation. Is > this a bug or a feature or something I'm supposed to be specifying on > the command line? > > I'm using zope.testing-3.7.7, which is what comes with Zope 2.12. > > Martin > > -- > Author of `Professional Plone Development`, a book for developers who > want to work with Plone. See http://martinaspeli.net/plone-book > > ___ > Zope-Dev maillist - zope-...@zope.org > https://mail.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > https://mail.zope.org/mailman/listinfo/zope-announce > https://mail.zope.org/mailman/listinfo/zope ) > ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] zope.testing coverage support
Hi, A couple of questions about zope.testing's --coverage option: 1. When specifying the coverage output directory, I have to specify an absolute path: ./bin/test -s plone.caching --coverage="$(pwd)/coverage" works ./bin/test -s plone.caching --coverage="coverage" does not. Is this intentional? It took me ages to figure out this was necessary. 2. Is there anything that can read the coverage output files and present them with syntax highlighting and highlight problem areas? I know other tools (like Cobertura) have this. Is there a standard, or is it a custom format? 3. I get coverage reporting for my tests (i.e. it lists coverage of the tests package). The PyPI page for zope.testing talks about ignoring tests, but that part of the doctest is not useful as documentation. Is this a bug or a feature or something I'm supposed to be specifying on the command line? I'm using zope.testing-3.7.7, which is what comes with Zope 2.12. Martin -- Author of `Professional Plone Development`, a book for developers who want to work with Plone. See http://martinaspeli.net/plone-book ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )