[TOX] can't pass tox on clean build

Asked by Ivar Lazzaro

Hello,

Trying to run tox (tox -epy27) from the root of a brand new cloned Quantum build, I obtain a bunch of errors ALL like the following:

ImportError: Failed to import test module: quantum.tests.unit.testlib_api
Traceback (most recent call last):
  File "/usr/lib/python2.7/unittest/loader.py", line 252, in _find_tests
    module = self._get_module_from_name(name)
  File "/usr/lib/python2.7/unittest/loader.py", line 230, in _get_module_from_name
    __import__(name)
  File "/opt/stack/quantum/quantum/tests/unit/testlib_api.py", line 20, in <module>
    from quantum import wsgi
  File "/opt/stack/quantum/quantum/wsgi.py", line 39, in <module>
    from quantum import context
  File "/opt/stack/quantum/quantum/context.py", line 24, in <module>
    from quantum.db import api as db_api
  File "/opt/stack/quantum/quantum/db/api.py", line 23, in <module>
    from quantum.openstack.common.db.sqlalchemy import session
  File "/opt/stack/quantum/quantum/openstack/common/db/sqlalchemy/session.py", line 283, in <module>
    deprecated_opts=[cfg.DeprecatedOpt('sql_connection',
AttributeError: 'module' object has no attribute 'DeprecatedOpt'

And then it ends this way:

----------------------------------------------------------------------
Binary content:
  traceback (test/plain; charset="utf8")
Ran 501 tests in 2.623s (-0.267s)
FAILED (id=8, failures=127)
error: testr failed (1)
ERROR: InvocationError: '/opt/stack/quantum/.tox/py27/bin/python setup.py testr --slowest --testr-args='
______________________________________________________________________ summary _______________________________________________________________________
ERROR: py27: commands failed

Am I missing something? :)

Question information

Language:
English Edit question
Status:
Solved
For:
neutron Edit question
Assignee:
No assignee Edit question
Solved by:
yong sheng gong
Solved:
Last query:
Last reply:
Revision history for this message
Best yong sheng gong (gongysh) said :
#1

try to remove your current oslo module in system and then install: http://tarballs.openstack.org/oslo.config/oslo.config-1.2.0a2.tar.gz#egg=oslo.config-1.2.0a2.

For example:
cd /usr/local/lib/python2.7/dist-packages/
rm -rf oslo
pip install http://tarballs.openstack.org/oslo.config/oslo.config-1.2.0a2.tar.gz#egg=oslo.config-1.2.0a2

and then remove your .tox
and then do tox -e py27

Revision history for this message
Eugene Nikanorov (enikanorov) said :
#2

I think it should be done within .tox/py27 directory

Revision history for this message
Ivar Lazzaro (mmaleckk) said :
#3

Thanks yong sheng gong, that solved my question.

Revision history for this message
Ivar Lazzaro (mmaleckk) said :
#4

Note: I followed yong shen gong suggestion, but I changed the oslo module from the .tox/py27 directory just like Eugene said.

Revision history for this message
Rajdeep (dua-rajdeep) said :
#5

I had to move oslo from /usr/local/lib/python2.7/dist-packages/ to .tox/py27/lib/python2.7/site-packages/