Skip to content

Commit

Permalink
Load app before loading legacy client in tests.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jamie Lennox committed Jul 18, 2013
1 parent 53ed50d commit 2aaa902
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_keystoneclient.py
Expand Up @@ -38,6 +38,9 @@ class CompatTestCase(test.TestCase):
def setUp(self):
super(CompatTestCase, self).setUp()

self.public_server = self.serveapp('keystone', name='main')
self.admin_server = self.serveapp('keystone', name='admin')

revdir = test.checkout_vendor(*self.get_checkout())
self.add_path(revdir)
self.clear_module('keystoneclient')
Expand All @@ -46,9 +49,6 @@ def setUp(self):
self.token_provider_api = token.provider.Manager()
self.load_fixtures(default_fixtures)

self.public_server = self.serveapp('keystone', name='main')
self.admin_server = self.serveapp('keystone', name='admin')

# TODO(termie): add an admin user to the fixtures and use that user
# override the fixtures, for now
self.metadata_foobar = self.identity_api.add_role_to_user_and_project(
Expand Down

0 comments on commit 2aaa902

Please sign in to comment.