Remove duplicated tests code in Nova tests

Registered by Alexei Kornienko on 2013-06-21

Lots of code in nova tests is duplicated.
This blueprint is a summary list of problem places that needs to be worked on

We should create separate classes for different methods tests to improve tests setUp code.
Tests should be refactored to remove duplicated code and improve test assertions.

Blueprint information

Russell Bryant
Alexei Kornienko
Alexei Kornienko
Series goal:
Accepted for havana
Milestone target:
milestone icon 2013.2
Started by
Russell Bryant
Completed by
Russell Bryant

Related branches



Currently this tests have following problems:
1) Different tests use different methods to setup fixtures and stubs
2) A lot of setup code is duplicated
3) Test classes a too big and should be separated in smaller ones
4) Some tests assertions are quite bad and not actually asserting anything
5) some test code can be organized a little bit to create simple DSL like methods to help understand main test goal
6) need to add several tests to improve tests coverage

Gerrit topic:,topic:bp/api-compute-servers-tests,n,z

Addressed by:
    Moved tests for server.delete

Addressed by:
    Removed code duplication in api.compute.servers tests

Addressed by:
    Moved tests for server._action_rebuild

Addressed by:
    Code dedup in tests for server._action_rebuild

Addressed by:
    Refactor TestAddressesXMLSerialization class.

Gerrit topic:,topic:api-compute-servers-tests,n,z

Addressed by:
    Refactor test_update_* from in current API tests and v3.

Addressed by:
    Refactor class ServersControllerCreateTest

Addressed by:
    Refactor ServerStatusTest class

Addressed by:
    Ref?ctor test_quota_sets.

Gerrit topic:,topic:nova-tests-code-duplication,n,z

Addressed by:
    Refactor test_evacuate.

Gerrit topic:,topic:bp/nova-tests-code-duplication,n,z

Addressed by:
    Refactor class ImageXMLSerializationTest

Addressed by:
    Refactor ServersViewBuilderTest class.

Addressed by:
    Refactor class ImagesControllerTest

Addressed by:
    Refactor class TestServerActionRequestXMLDeserializer

Addressed by:
    Move tests in virt.libvirt.test_imagecache

Addressed by:
    Refactor test_libvirt_vif

Addressed by:
    Make ServerXMLSerializationTest DRYer

Addressed by:
    Refactor virt.libvirt.test_imagecache.test_verify_checksum_*

Addressed by:
    Refactor test_libvirt_volume

Addressed by:
    Refactor class InstanceTypeExtraSpecsTestCase

Addressed by:
    Refactor class QuotaReserveSqlAlchemyTestCase

Addressed by:
    Make EvacuateTest DRYer

Addressed by:
    Move tests test_update_* to separate class

Addressed by:
    Code dedup in test_update_*

Addressed by:
    Refactor unittest for extensions os-images v3


Work Items

Work items:
[alexei-kornienko] test_delete_server_* : DONE
[alexei-kornienko] test_get_server_* : DONE
[akamyshnikova] test_rebuild_instance_*: INPROGRESS
[akamyshnikova] class ServersControllerCreateTest : DONE
[akamyshnikova] class ImageXMLSerializationTest : DONE
[akamyshnikova] virt.libvirt.test_libvirt_vif.: DONE
[akamyshnikova] virt.libvirt.test_libvirt_volume.: DONE
[eyuzlikeev] plugins.v3.test_quota_sets: INPROGRESS
[eyuzlikeev] plugins.v3.test_evacuate: DONE
[eyuzlikeev] virt.libvirt.test_libvirt: INPROGRESS
[a-gorodnev] class TestAddressesXMLSerialization: DONE
[a-gorodnev] class ServersViewBuilderTest: DONE
[a-gorodnev] class ServerXMLSerializationTest: DONE
[a-gordeev] class ServerStatusTest: DONE
[eezhova] test_update_* : DONE
[eezhova] class ImagesControllerTest: DONE
[eezhova] class TestServerActionRequestXMLDeserializer: DONE
[eezhova] virt.libvirt.test_imagecache.test_verify_checksum_*: DONE
[eezhova] class InstanceTypeExtraSpecsTestCase: DONE
[eezhova] class QuotaReserveSqlAlchemyTestCase: DONE

This blueprint contains Public information 
Everyone can see this information.