[openstack-dev] [Keystone] unit test coverage

Adam Young ayoung at redhat.com
Wed Dec 5 03:10:11 UTC 2012


I just realized that run_test.sh has an option to generate test 
coverage.  As I go through and do a bit of refactoring, I am painfully 
aware at how dependent we are on unit tests to make sure we don't break 
anything.

Results:

http://admiyo.fedorapeople.org/openstack/covhtml/

I would say that we are not doing too bad.  Our total is 81% right now.  
A good chunk of that comes from Open stack common, where we don't run or 
test all the code we pull in.

The worst offenders right now:

keystone.identity.backends.pam  51%

This seems odd.  I wonder if we are disabling more tests than we 
should.  This backend should be easy to keep up with SQL.

Some other notables.

keystone.common.controller 57%    Short file, but critical to most other 
things.
http://admiyo.fedorapeople.org/openstack/covhtml/keystone_common_controller.html
Looks like that should be testing RBAC.


SQL tests across the board we need more testing of downgrade.
Example:
http://admiyo.fedorapeople.org/openstack/covhtml/keystone_common_sql_migrate_repo_versions_004_undo_token_id_hash.html


keystone.common.ldap.core 73%     Paging code is untested.   Also, a few 
of the helper functions at the top look like they are unused and can be 
removed.  I like removing code.

keystone.common.utils         64%     If the utilities are not being 
used, we should probably remove them.
keystone.identity.core           62%     No Big deal:  all the un 
implemented functions.

So, if you are touching any of these files, try and up the percentage.

We should review the test coverage in the weekly meeting.




More information about the OpenStack-dev mailing list