Nosetest provides a command line switch which will generate statistics on what lines of code are run during tests.
For Keystone, we can generate them using:
cd /opt/stack/keystone ./run_tests.sh -c
The tests are put in tests/cover/
I ran them recently and posted the current stats to my fedorapeople site.
Note that I posted them using rsync. I use rsync infrequently enough that I have to look up the correct command line in the man page each time.
rsync -ac tests/cover/ email@example.com:public_html/openstack/keystone/coverage/
Some things that jump out from the report:
keystone.identity.backends.pam Is very low: 41%. We should either remove this backend or get it functional.
keystone.contrib.ec2.core are both in the 60s. I know I looked at these before, and there are bugs open against them. They could use better tests.
Most of the other files that are at less than 100% are due primarily to Exception code that is not run. This says to me that, while we do a decent job of positive thread testing, we need to work on the more exceptional cases.
For the keystone client:
cd /opt/stack/python-keystoneclient/ ./run_tests.sh -c rsync -ac covhtml/ firstname.lastname@example.org:public_html/openstack/python-keystoneclient/coverage/