Fix and improve cross-project functional testing
Make sure stestr is executed using the python interpreter set inside the virtualenv, otherwise the libraries installed there may not found. This is due to the fact that (stestr default shebang points to system python when installed through devstack and the functional tox target uses that version thanks to sitepackages=True. The sitepackages option must be used to find a few system ceph/python libraries not available on pypi. Setting PATH is not really needed nowadays, so remove the custom workaround. It is worth noting that the hack would not be needed anymore and PATH could be set through setenv (extending {env:PATH}). As cinderlib changes can break cinder and cinder-tempest-plugin, and they indeed did it in the past, so ensure that everything works by running cinder-tempest-plugin-lvm-lio-barbican. Change-Id: I40ef42b4224521abed00b3b210418ec96c1116ea
This commit is contained in:
parent
4347547a0d
commit
d982db6264
|
@ -11,6 +11,7 @@
|
|||
|
||||
- cinderlib-lvm-functional
|
||||
- cinderlib-ceph-functional
|
||||
- cinder-tempest-plugin-lvm-lio-barbican
|
||||
gate:
|
||||
queue: integrated
|
||||
jobs:
|
||||
|
@ -20,6 +21,7 @@
|
|||
|
||||
- cinderlib-lvm-functional
|
||||
- cinderlib-ceph-functional
|
||||
- cinder-tempest-plugin-lvm-lio-barbican
|
||||
post:
|
||||
jobs:
|
||||
- publish-openstack-python-branch-tarball
|
||||
|
|
10
tox.ini
10
tox.ini
|
@ -39,7 +39,6 @@ passenv = CL_FTEST_POOL_NAME
|
|||
setenv = OS_TEST_PATH=./cinderlib/tests/functional
|
||||
CL_FTEST_CFG={env:CL_FTEST_CFG:{toxinidir}/cinderlib/tests/functional/lvm.yaml}
|
||||
CL_FTEST_ROOT_HELPER={env:CL_FTEST_ROOT_HELPER:{toxinidir}/tools/virtualenv-sudo.sh}
|
||||
ADD_PATHS=/usr/local/sbin:/usr/sbin
|
||||
|
||||
sitepackages = True
|
||||
# Not reusing py37's env due to https://github.com/tox-dev/tox/issues/477
|
||||
|
@ -48,12 +47,13 @@ sitepackages = True
|
|||
# Must run serially or test_stats_with_creation may fail occasionally
|
||||
commands =
|
||||
find . -ignore_readdir_race -type f -name "*.pyc" -delete
|
||||
# Tox has a bug and it ignores the PATH set in setenv, so we work around it
|
||||
bash -i -c "PATH=$PATH:$ADD_PATHS stestr run --serial {posargs}"
|
||||
stestr slowest
|
||||
# run stestr through python -m so that the python from the virtualenv
|
||||
# is used; stestr's shebang may point to system python, thus breaking
|
||||
# the lookup of modules from the venv.
|
||||
python -m stestr run --serial {posargs}
|
||||
python -m stestr slowest
|
||||
|
||||
whitelist_externals =
|
||||
bash
|
||||
find
|
||||
stestr
|
||||
|
||||
|
|
Loading…
Reference in New Issue