Ask Your Question
0

Why do V3 API tests fail when run using nose but not run_tests.sh?

asked 2013-06-06 18:26:45 -0500

Just ran into this issue, so capturing the answer here for posterity.

In the past, you could run the tests with:

nosetests

and everything worked fine.

If you try that now, however, you may notice that some V3 API tests fail. Strangely, the tests will pass if you run them under tox or run_tests.sh.

Solution

Set the PYTHONPATH to you nova root directory, most likely your current-working directory like so:

PYTHONPATH=. nosetests

Reason

The V3 API uses stevedore to load plugins, which in turn uses entry points.

pkg_resources, the standard-library module for finding these entry-points keys off of sys.path.

The problem is that, when the nosetests binary is run, its current-working directory is something like '~/.virtualenvs/openstack/bin'. This means that it won't find the nova package in your current working directory.

To force it to find it, we can add the current directory to the sys.path by explicitly setting PYTHONPATH.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-06-06 18:27:10 -0500

Answered this myself.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-06-06 18:26:45 -0500

Seen: 14 times

Last updated: Jun 06 '13