Merge "add py27-dev and pep8-dev tox targets"

This commit is contained in:
Zuul 2018-03-23 15:29:59 +00:00 committed by Gerrit Code Review
commit b457bfaa6d
3 changed files with 93 additions and 3 deletions

View File

@ -30,6 +30,22 @@ function _nsxv_ini_set {
}
function nsxv_configure_service {
# TODO(boden): find a better way to use master branch dependencies in devstack
sudo rm -rf /usr/local/lib/python2.7/dist-packages/networking_l2gw*
sudo pip install -e "git+https://git.openstack.org/openstack/networking-l2gw#egg=networking_l2gw"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/networking_sfc*
sudo pip install -e "git+https://git.openstack.org/openstack/networking-sfc#egg=networking_sfc"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_lbaas*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-lbaas#egg=neutron_lbaas"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_fwaas*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-fwaas#egg=neutron_fwaas"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_dynamic_routing*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-dynamic-routing#egg=neutron_dynamic_routing"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_vpnaas*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-vpnaas#egg=neutron_vpnaas"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/vmware_nsxlib*
sudo pip install -e "git+https://git.openstack.org/openstack/vmware-nsxlib#egg=vmware_nsxlib"
if [[ "$NSX_L2GW_DRIVER" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_l2gw_driver $NSX_L2GW_DRIVER
fi
@ -92,6 +108,22 @@ function _nsxv3_ini_set {
}
function nsxv3_configure_service {
# TODO(boden): find a better way to use master branch dependencies in devstack
sudo rm -rf /usr/local/lib/python2.7/dist-packages/networking_l2gw*
sudo pip install -e "git+https://git.openstack.org/openstack/networking-l2gw#egg=networking_l2gw"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/networking_sfc*
sudo pip install -e "git+https://git.openstack.org/openstack/networking-sfc#egg=networking_sfc"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_lbaas*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-lbaas#egg=neutron_lbaas"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_fwaas*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-fwaas#egg=neutron_fwaas"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_dynamic_routing*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-dynamic-routing#egg=neutron_dynamic_routing"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_vpnaas*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-vpnaas#egg=neutron_vpnaas"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/vmware_nsxlib*
sudo pip install -e "git+https://git.openstack.org/openstack/vmware-nsxlib#egg=vmware_nsxlib"
if [[ $1 == "nsx_v3" ]]; then
_nsxv3_ini_set default_overlay_tz $DEFAULT_OVERLAY_TZ_UUID "The VMware NSX plugin won't work without a default transport zone."
else

View File

@ -112,6 +112,21 @@ function neutron_plugin_create_nova_conf {
function neutron_plugin_install_agent_packages {
# VMware NSX Plugin does not run q-agt, but it currently needs dhcp and metadata agents
_neutron_ovs_base_install_agent_packages
# TODO(boden): find a better way to use master branch dependencies in devstack
sudo rm -rf /usr/local/lib/python2.7/dist-packages/networking_l2gw*
sudo pip install -e "git+https://git.openstack.org/openstack/networking-l2gw#egg=networking_l2gw"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/networking_sfc*
sudo pip install -e "git+https://git.openstack.org/openstack/networking-sfc#egg=networking_sfc"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_lbaas*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-lbaas#egg=neutron_lbaas"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_fwaas*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-fwaas#egg=neutron_fwaas"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_dynamic_routing*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-dynamic-routing#egg=neutron_dynamic_routing"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/neutron_vpnaas*
sudo pip install -e "git+https://git.openstack.org/openstack/neutron-vpnaas#egg=neutron_vpnaas"
sudo rm -rf /usr/local/lib/python2.7/dist-packages/vmware_nsxlib*
sudo pip install -e "git+https://git.openstack.org/openstack/vmware-nsxlib#egg=vmware_nsxlib"
}
function neutron_plugin_configure_common {

49
tox.ini
View File

@ -11,12 +11,12 @@ usedevelop = True
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = sh
whitelist_externals =
sh
stestr
commands =
stestr run {posargs}
stestr slowest
# there is also secret magic in ostestr which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:common]
# Fake job to define environment variables shared between dsvm/non-dsvm jobs
@ -56,6 +56,24 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
[testenv:py27]
setenv = OS_FAIL_ON_MISSING_DEPS=1
[testenv:py27-dev]
# run py27 locally (not in the gate) using editable mode
# https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
# note that order is important to ensure dependencies don't override
commands =
pip install -q -e "git+https://git.openstack.org/openstack/networking-l2gw#egg=networking_l2gw"
pip install -q -e "git+https://git.openstack.org/openstack/networking-sfc#egg=networking_sfc"
pip install -q -e "git+https://git.openstack.org/openstack/neutron-lbaas#egg=neutron_lbaas"
pip install -q -e "git+https://git.openstack.org/openstack/neutron-fwaas#egg=neutron_fwaas"
pip install -q -e "git+https://git.openstack.org/openstack/neutron-dynamic-routing#egg=neutron_dynamic_routing"
pip install -q -e "git+https://git.openstack.org/openstack/neutron-vpnaas#egg=neutron_vpnaas"
pip install -q -e "git+https://git.openstack.org/openstack/vmware-nsxlib#egg=vmware_nsxlib"
pip install -q -e "git+https://git.openstack.org/openstack/neutron#egg=neutron"
pip freeze
stestr run {posargs}
whitelist_externals =
stestr
[testenv:pep8]
basepython = python2.7
commands =
@ -70,6 +88,31 @@ whitelist_externals =
sh
bash
[testenv:pep8-dev]
# run pep8 locally (not in the gate) using editable mode
# https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
# note that order is important to ensure dependencies don't override
basepython = python2.7
commands =
pip install -q -e "git+https://git.openstack.org/openstack/networking-l2gw#egg=networking_l2gw"
pip install -q -e "git+https://git.openstack.org/openstack/networking-sfc#egg=networking_sfc"
pip install -q -e "git+https://git.openstack.org/openstack/neutron-lbaas#egg=neutron_lbaas"
pip install -q -e "git+https://git.openstack.org/openstack/neutron-fwaas#egg=neutron_fwaas"
pip install -q -e "git+https://git.openstack.org/openstack/neutron-dynamic-routing#egg=neutron_dynamic_routing"
pip install -q -e "git+https://git.openstack.org/openstack/neutron-vpnaas#egg=neutron_vpnaas"
pip install -q -e "git+https://git.openstack.org/openstack/vmware-nsxlib#egg=vmware_nsxlib"
pip install -q -e "git+https://git.openstack.org/openstack/neutron#egg=neutron"
pip freeze
# If it is easier to add a check via a shell script, consider adding it in this file
sh ./tools/misc-sanity-checks.sh
# Checks for coding and style guidelines
flake8 {toxinidir}/vmware_nsx
sh ./tools/coding-checks.sh --pylint '{posargs}'
neutron-db-manage --subproject vmware-nsx check_migration
{[testenv:genconfig]commands}
whitelist_externals =
sh
[testenv:bandit]
commands = bandit -r vmware_nsx -n 5 -ll