Keystone Client tests find old contrib.ec2

Bug #1178532 reported by Jamie Lennox on 2013-05-10
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Medium
Jamie Lennox

Bug Description

When running older keystone client tests one of the first things to happen is we remove the keystoneclient module from the loaded modules and replace it with the older module that we want to test.

At some point (obviously post Essex) an ec2 utils file was moved into the keystone client:
    keystone/contrib/ec2/core.py:39
    from keystoneclient.contrib.ec2 import utils as ec2_utils.

From what i can make out our tests will only pass if the Essex and 0.1.1 client tests are run some time after that file has been loaded from a fresh version first.

For example:
./run_tests.sh test_keystoneclient test_keystoneclient:KcEssex3TestCase
will fail every test with
    from keystoneclient.contrib.ec2 import utils as ec2_utils
    ImportError: No module named contrib.ec2

because it successfully loaded the keystoneclient module that was checked out into vendor/python-keystoneclient-essex-3 which does not have the contrib/ec2/utils file.

when we run ./run_tests.sh directly keystone/contrib/ec2/core is loaded at least once in the sequence of tests before the client tests reset it. This means that ec2_utils is imported from the keystoneclient in our library path and the tests succeed.

As nose resolves tests alphabetically another way of seeing this is to rename test_keystoneclient.py -> test_aaakeystoneclient.py and ./run_tests.sh so that these tests runs first.

Dolph Mathews (dolph) on 2013-06-07
Changed in keystone:
status: New → Triaged
importance: Undecided → Medium
Adam Young (ayoung) wrote :

We should move the old python keystone client tests to tempest.

Changed in keystone:
importance: Medium → High
Dolph Mathews (dolph) wrote :

This is valuable high priority *work*, but it's not a high priority *bug* by any means.

Changed in keystone:
importance: High → Medium
Changed in keystone:
assignee: nobody → Jamie Lennox (jamielennox)
status: Triaged → In Progress

Reviewed: https://review.openstack.org/36395
Committed: http://github.com/openstack/keystone/commit/2aaa902d6eb16fe9ee2e7bc262c1b29731c03a0c
Submitter: Jenkins
Branch: master

commit 2aaa902d6eb16fe9ee2e7bc262c1b29731c03a0c
Author: Jamie Lennox <email address hidden>
Date: Wed Jul 10 16:45:18 2013 +1000

    Load app before loading legacy client in tests.

    When you load an old version of keystoneclient doing legacy tests and
    then start the test app the ec2 work that depends on keystoneclient sees
    the recently loaded legacy one which doesn't have the required modules
    in it.

    If we load the app first the ec2 modules are resolved and finds the
    original keystone client. The ec2 module then uses
    'from keystoneclient.contrib.ec2 import utils as ec2_utils' so the
    ec2_utils reference is kept in the file scope so isn't affected by the
    tests changing keystoneclient.

    It is not a long term fix for bug 1178532 but it solves the immediate
    symptoms when running client tests independently.

    Change-Id: I7267ca0d4740f037884fae95f8a6562ee86584b9

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-09-05
Changed in keystone:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in keystone:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers