More tests
Test cases update
Today and yesterday, I worked on creating test cases for the manifest creation code. Currently there are two versions of the manifest creation, one Rob and one I wrote. Rob's uses os.walk which turns out to do too much stat'ing of the filesystem. After discussing this in OSS, I wrote one that caches the stat results so that it's minimal (down to around 55%--60%) and in turn runs about 50% faster. Here are some statistics that someone may find interesting:
- 712 total executable lines (94% coverage)
- 495 lines from testing (99% coverage)
- 211 lines from the actual code (82% coverage)
- 6 lines from the runtests.py file (100% coverage)
- 58 total tests (87.9% pass)
- manifest tests all pass (22 tests)
- manifest creation tests (18 for each version)
- Rob's has 7 failures (symlink resolution, file ordering)
- Mine passes all (had to fix up some things, see the logs)
Unfortunately, the test cases currently only work with a umask of 022 (bug here) since that is what my desktop has set (probably zsh defaults vs. bash defaults). These expectations will be removed at some point in the future.
Comments