Metering test plugin includes initialization code as well as tests

Bug #1336198 reported by Assaf Muller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Assaf Muller

Bug Description

Currently the metering test case includes setUp code as well as the tests themselves. Splitting up the test case class into two allows other test cases to inherit the metering plugin class without inherting (And implicitly re-running) the tests themselves.

Tags: unittest
Assaf Muller (amuller)
Changed in neutron:
assignee: nobody → Assaf Muller (amuller)
Changed in neutron:
status: New → In Progress
Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

and what would be the benefit?

Revision history for this message
Assaf Muller (amuller) wrote :

It's needed for:
https://review.openstack.org/#/c/92600/3/neutron/tests/unit/services/identity/test_identity_plugin.py

line 126.

That patch is currently dependent on the patch that splits the metering test plugin initialization code from its tests. Otherwise, TestIdentityMeter in the patch I linked above would re-run the metering tests from the base class, which is completely unneeded.

Revision history for this message
Assaf Muller (amuller) wrote :

An additional small note: All other test plugins are divided into a class which does initialization code, and another class which contains only tests. This is for good reason as it solves the issue outlined in comment 2. The only test plugin which doesn't do it this way is the metering test plugin...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/91798
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=fd772afb697b70bf9da009976681a2a67d6fa5f1
Submitter: Jenkins
Branch: master

commit fd772afb697b70bf9da009976681a2a67d6fa5f1
Author: Assaf Muller <email address hidden>
Date: Fri May 2 17:21:05 2014 +0300

    Split up metering test case into plugin + test case

    Currently the metering test case includes setUp code as well
    as the tests themselves. Splitting up the test case class
    into two allows other test cases to inherit the metering
    plugin class without inherting (And implicitly re-running)
    the tests themselves.

    Closes-Bug: #1336198
    Change-Id: I4427fcd17cc3d28189f9f74df487084cf35c1634

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.