Merge lp://qastaging/~rackspace-titan/nova/libvirt-no-globals into lp://qastaging/~hudson-openstack/nova/trunk

Proposed by Brian Lamar
Status: Work in progress
Proposed branch: lp://qastaging/~rackspace-titan/nova/libvirt-no-globals
Merge into: lp://qastaging/~hudson-openstack/nova/trunk
Diff against target: 464 lines (+82/-61)
6 files modified
nova/tests/test_libvirt.py (+35/-29)
nova/utils.py (+9/-0)
nova/virt/libvirt/connection.py (+18/-25)
nova/virt/libvirt/firewall.py (+10/-7)
run_tests.py (+9/-0)
tools/pip-requires (+1/-0)
To merge this branch: bzr merge lp://qastaging/~rackspace-titan/nova/libvirt-no-globals
Reviewer Review Type Date Requested Status
Alex Meade (community) Approve
Vish Ishaya (community) Approve
Review via email: mp+62371@code.qastaging.launchpad.net

Commit message

Added support for skipping tests via unittest2. Re-worked imports in libvirt/connection.py and test_libvirt.py to use new optional_import method. Libvirt tests will now show up as "SKIP" instead of "OK" when being skipped.

Description of the change

Added the ability to "skip" tests, as provided by unittest2 (which back-ports python2.7 functionality and can be removed later once python2.7+ is required).

The ability to skip tests was needed because the current method of skipping (in test_libvirt.py) displayed "OK" when skipping tests. This will make things much more evident to the user when tests are being skipped.

Along with this change is `utils.optional_import` which allows for removal of all "globals" being used in libvirt code. This was the primary motivator for adding test skipping as globals were being used for importing in test_libvirt.py.

To post a comment you must log in.
Revision history for this message
Vish Ishaya (vishvananda) wrote :

I like these changes. Thanks for working on cleanup Brian!

review: Approve
Revision history for this message
Alex Meade (alex-meade) wrote :

I love good solid cleanup like this, especially with regard to tests. Good work

review: Approve
Revision history for this message
Brian Lamar (blamar) wrote :

Moved to WIP, I need to ensure 2.6 compatibility. Waldon pointed out I might have a small issue...

Unmerged revisions

1111. By Brian Lamar

Added the ability to "skip" tests, as provided by unittest2 (which back-ports python2.7 functionality and can be removed later once python2.7+ is required). The ability to skip tests was needed because the current method of skipping displayed "OK" when skipping tests. This will make things much more evident to the user when tests are being skipped. Along with this change is `utils.optional_import` which allows for removal of all "globals" being used in libvirt code.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.