Attached is a patch which adds support for a 'make coverage' build command to pykickstart. It runs the tests with the python-coverage command to produce coverage information.
Cheers,
Stef
On 12/04/2012 04:51 PM, Chris Lumens wrote:
diff --git a/.gitignore b/.gitignore index e5456c4..749903a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ po/*.po pykickstart*.tar.gz pykickstart*.tar.bz2 +/.coverage
What should this file look like?
This is a directory created by python-coverage. When you use 'coverage run' it creates this directory. When you later use 'coverage report' you can see the coverage report.
Additionally you can use other tools like my 'git coverage' extension [1] which uses the information in this directory to show you the coverage of a recent patch (or arbitrary diff).
Cheers,
Stef
This is a directory created by python-coverage. When you use 'coverage run' it creates this directory. When you later use 'coverage report' you can see the coverage report.
Oh, this is cool.
So when I run "make coverage", I assume the results I am seeing are for the entirety of the test suite, not just the last test that got run. Is that correct? If so, this could really help drive writing some more test cases for pykickstart.
- Chris
On 12/05/2012 09:40 PM, clumens@redhat.com wrote:
So when I run "make coverage", I assume the results I am seeing are for the entirety of the test suite, not just the last test that got run. Is that correct?
Yup.
If you want to provide some output by default when you run 'make coverage', we could add a line like this to the coverage target:
PYTHONPATH=. coverage report --show-missing --include='pykickstart/*'
Attached is an updated patch with that line.
Cheers,
Stef
If you want to provide some output by default when you run 'make coverage', we could add a line like this to the coverage target:
PYTHONPATH=. coverage report --show-missing --include='pykickstart/*'
Attached is an updated patch with that line.
I like this quite a bit, thanks for the patch. I've pushed it to master.
- Chris
anaconda-patches@lists.fedorahosted.org