Tests shouldn't rely on provider registration by import

Bug #1408389 reported by Brant Knudson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Brant Knudson

Bug Description

The tests shouldn't be relying on the provider being loaded by importing a module. When the server is actually run, it only imports the module if the extension is in the paste pipeline, and the tests shoud work similarly.

Also, tests shouldn't be using @dependency.requires to inject dependencies -- this is for use by keystone server parts. The tests have their own way of getting dependencies injected by loading the manager, which is similar to how the Keystone server works.

Brant Knudson (blk-u)
Changed in keystone:
assignee: nobody → Brant Knudson (blk-u)
Changed in keystone:
status: New → In Progress
Revision history for this message
Brant Knudson (blk-u) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/124603
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=9e5aa70c365070a7c5484488b2ddb3319937e260
Submitter: Jenkins
Branch: master

commit 9e5aa70c365070a7c5484488b2ddb3319937e260
Author: Brant Knudson <email address hidden>
Date: Sat Sep 27 11:27:58 2014 -0500

    Fix tests using extension drivers

    The tests were assuming that extension drivers (such as federation
    and revoke_api) were always loaded. These drivers were only
    available because a previous test had imported the module and its
    factory method is stored in global state in the dependency module.

    The base Testcase is changed to not set up the saml2 and oauth1
    auth plugins by default. The saml2 auth plugin depends on the
    federation API which is only available when the extension is
    loaded; similarly for the oauth1 auth plugin.

    A new method is added to base TestCase to allow the TestCase to
    provide more drivers to load during setUp. The TestCases that need
    to load an optional backend make use of it.

    Closes-Bug: #1408389
    Change-Id: I5774fbe136849b4d1e80e64f3791dc295458e446

Changed in keystone:
status: In Progress → Fix Committed
Changed in keystone:
importance: Undecided → Low
milestone: none → kilo-2
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: kilo-2 → 2015.1.0
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.