Tests fail if project's dir name is "wrong"

Bug #1124283 reported by Dolph Mathews
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-keystoneclient
Fix Released
Low
Dolph Mathews

Bug Description

Cloning the project into an arbitrary directory causes tests to fail because the tests assume a hardcoded directory name.

  $ git clone git://github.com/openstack/python-keystoneclient.git foobar
  $ cd foobar/
  $ python setup.py develop
  $ sh run_tests.sh -N
  ...
  ======================================================================
  ERROR: test suite for <module 'tests.test_auth_token_middleware' from '.../foobar/tests/test_auth_token_middleware.py'>
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/Users/dolph/Environments/os/lib/python2.7/site-packages/nose/suite.py", line 208, in run
      self.setUp()
    File "/Users/dolph/Environments/os/lib/python2.7/site-packages/nose/suite.py", line 291, in setUp
      self.setupContext(ancestor)
    File "/Users/dolph/Environments/os/lib/python2.7/site-packages/nose/suite.py", line 314, in setupContext
      try_run(context, names)
    File "/Users/dolph/Environments/os/lib/python2.7/site-packages/nose/util.py", line 476, in try_run
      return func(obj)
    File ".../foobar/tests/test_auth_token_middleware.py", line 164, in setUpModule
      with open(os.path.join(signing_path, 'auth_token_scoped.pem')) as f:
  IOError: [Errno 2] No such file or directory: '.../python-keystoneclient/examples/pki/cms/auth_token_scoped.pem'

  ----------------------------------------------------------------------
  Ran 188 tests in 1.222s

  FAILED (errors=1)

Changed in python-keystoneclient:
assignee: nobody → Dolph Mathews (dolph)
status: New → In Progress
Dolph Mathews (dolph)
Changed in python-keystoneclient:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/21887
Committed: http://github.com/openstack/python-keystoneclient/commit/9196be6664b453cced316842ba9d67caa389517a
Submitter: Jenkins
Branch: master

commit 9196be6664b453cced316842ba9d67caa389517a
Author: Dolph Mathews <email address hidden>
Date: Wed Feb 13 10:05:49 2013 -0600

    Remove test dep on name of dir (bug 1124283)

    The name of the project's directory was previously hardcoded into the
    tests, so tests would fail if executed from another directory (such as
    "python-keystoneclient-master", as checked-out by keystone for
    integration testing).

    Also, the tests should now be executable on Windows.

    Change-Id: I0a1e052054e509b0f795fd13f95a804e0c255907

Changed in python-keystoneclient:
status: In Progress → Fix Committed
Dolph Mathews (dolph)
Changed in python-keystoneclient:
milestone: none → 0.2.3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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