sgh I can't run individual tests anymore.
Bug #1182037 and its implementation https://review.openstack.org/#/c/33030/ have the side effect of importing the cinder.common.config module only in the bin/ scripts or in the cinder.tests module. So when I try and run individual tests I exercise a different import ordering and get the following error:
raceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/run.py", line 368, in <module>
main(sys.argv, sys.stdout)
File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/run.py", line 365, in main
stdout=stdout)
File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/run.py", line 175, in __init__
self.parseArgs(argv)
File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/run.py", line 252, in parseArgs
self.createTests()
File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/run.py", line 261, in createTests
self.module)
File "/usr/lib/python2.7/unittest/loader.py", line 128, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/usr/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "cinder/volume/__init__.py", line 30, in <module>
API = import_utils.import_class(CONF.volume_api_class)
File "/opt/stack/cinder/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1187, in __getattr__
return self._get(name)
File "/opt/stack/cinder/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1509, in _get
value = self._substitute(self._do_get(name, group))
File "/opt/stack/cinder/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1525, in _do_get
info = self._get_opt_info(name, group)
File "/opt/stack/cinder/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1625, in _get_opt_info
raise NoSuchOptError(opt_name, group)
oslo.config.cfg.NoSuchOptError: no such option: volume_api_class
More worringly on a clean branch I am getting the following failing test, due to the same issue. I am wondering why it is just me getting this and the jenkins gate job is failing on this?
======================================================================
FAIL: unittest.loader.ModuleImportFailure.cinder.tests.test_backup_ceph
----------------------------------------------------------------------
_StringException: ImportError: Failed to import test module: cinder.tests.test_backup_ceph
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/cinder/cinder/tests/test_backup_ceph.py", line 22, in <module>
from cinder.backup.drivers.ceph import CephBackupDriver
File "/opt/stack/cinder/cinder/backup/__init__.py", line 27, in <module>
API = cinder.openstack.common.importutils.import_class(CONF.backup_api_class)
File "/opt/stack/cinder/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1187, in __getattr__
return self._get(name)
File "/opt/stack/cinder/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1509, in _get
value = self._substitute(self._do_get(name, group))
File "/opt/stack/cinder/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1525, in _do_get
info = self._get_opt_info(name, group)
File "/opt/stack/cinder/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1625, in _get_opt_info
raise NoSuchOptError(opt_name, group)
NoSuchOptError: no such option: backup_api_class
Fix proposed to branch: master /review. openstack. org/38148
Review: https:/