[TIP] Using coverage from API and command line gives different results

Alexander Todorov atodorov at redhat.com
Wed Feb 12 03:47:57 PST 2014


I think I've figure it out.

Adding source=['/usr/sbin/anaconda', 'pyanaconda'] produced the results I 
wanted. Without it I see coverage report for all other external modules loaded 
by anaconda but not pyanaconda (which is also in site-packages).

Can you explain why this is happening ?


If you'd still like to run the code try this:

1) Get a Fedora 20 DVD
2) Follow the instructions at
http://atodorov.org/blog/2014/02/07/tip-how-to-build-updates.img-for-fedora/

to build an updates.img   with the patch from

https://www.redhat.com/archives/anaconda-devel-list/2014-February/msg00002.html


or alternatively use these (Fedora 20, x86_64):
https://s3.amazonaws.com/atodorov/blog/updates_w_source_pyanaconda.img
https://s3.amazonaws.com/atodorov/blog/updates_wo_source.img

3) Start the installer (in a virtual machine) and add to the boot command line
updates=http://path/to/updates.img


4) Perform a default installation

5) After install is complete and system has rebooted there should be a 
/root/anaconda.coverage file.



Try both updates.img and see the differences in the coverage results.






More information about the testing-in-python mailing list