Attempt to get zuul and tox passing in this repo

Fix pylint by specifying a nodeset that contains
a python3 interpreter.  Switched the job to run py3.

This application needs to be installed into the virtualenv
in order for its entry points to be discoverable by
stevedore for the unit tests. However py27 fails to find
pbr during the sdist phase since the zuul node is running
a py35 virtualenv.

Disabling sdist should get pip to work. Other tox settings
should install it properly in the virtualenv.

Story: 2008943
Task: 43010
Signed-off-by: albailey <Al.Bailey@windriver.com>
Change-Id: I834a414f90d16d303c499e9ec3799ca5d02ca425
This commit is contained in:
albailey 2021-08-12 12:20:18 -05:00
parent 5b0faac2d6
commit cd0daf743e
4 changed files with 29 additions and 19 deletions

View File

@ -70,6 +70,7 @@
parent: tox
description: |
Run pylint test for k8sapp_oidc
nodeset: ubuntu-bionic
required-projects:
- starlingx/config
- starlingx/fault

View File

@ -2,12 +2,16 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=1.1.0,<=2.0.0 # Apache-2.0
bandit;python_version>="3.0"
coverage>=3.6
discover
isort<5;python_version>="3.0"
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
passlib>=1.7.0
psycopg2-binary
pylint<2.1.0;python_version<"3.0" # GPLv2
pylint<2.3.0;python_version>="3.0" # GPLv2
python-subunit>=0.0.18
requests-mock>=0.6.0 # Apache-2.0
sphinx

View File

@ -1,8 +1,7 @@
[tox]
envlist = flake8,py27,py36,pylint,bandit
minversion = 1.6
# skipsdist = True
#,pip-missing-reqs
skipsdist = True
# tox does not work if the path to the workdir is too long, so move it to /tmp
toxworkdir = /tmp/{env:USER}_k8soidctox
@ -10,20 +9,19 @@ stxdir = {toxinidir}/../../..
distshare={toxworkdir}/.tox/distshare
[testenv]
usedevelop = True
# usedevelop = True
# enabling usedevelop results in py27 develop-inst:
# Exception: Versioning for this project requires either an sdist tarball,
# or access to an upstream git repository.
# Note. site-packages is true and rpm-python must be yum installed on your dev machine.
sitepackages = True
#sitepackages = True
# tox is silly... these need to be separated by a newline....
whitelist_externals = bash
find
install_command = pip install \
-v -v -v \
-c{toxinidir}/upper-constraints.txt \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
{opts} {packages}
@ -43,14 +41,20 @@ setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
-e{[tox]stxdir}/config/tsconfig/tsconfig
-e{[tox]stxdir}/fault/fm-api
-e{[tox]stxdir}/fault/python-fmclient/fmclient
-e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient
-e{[tox]stxdir}/update/cgcs-patch/cgcs-patch
install_runtime =
pip install \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
-e {[tox]stxdir}/config/tsconfig/tsconfig \
-e {[tox]stxdir}/config/sysinv/sysinv/sysinv \
-e {[tox]stxdir}/fault/fm-api \
-e {[tox]stxdir}/fault/python-fmclient/fmclient \
-e {[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient \
-e {[tox]stxdir}/update/cgcs-patch/cgcs-patch
passenv =
XDG_CACHE_HOME
commands =
find . -type f -name "*.pyc" -delete
@ -67,6 +71,7 @@ commands =
[testenv:py27]
basepython = python2.7
commands =
{[testenv]install_runtime}
{[testenv]commands}
stestr run {posargs}
stestr slowest
@ -74,6 +79,7 @@ commands =
[testenv:py36]
basepython = python3.6
commands =
{[testenv]install_runtime}
{[testenv]commands}
stestr run {posargs}
stestr slowest
@ -92,18 +98,13 @@ commands = {posargs}
[testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
bandit
commands = bandit --ini tox.ini -n 5 -r k8sapp_oidc
[testenv:pylint]
basepython = python2.7
sitepackages = False
deps = {[testenv]deps}
pylint
basepython = python3
commands =
pylint {posargs} k8sapp_oidc --rcfile=./pylint.rc
{[testenv]install_runtime}
pylint {posargs} k8sapp_oidc --rcfile=./pylint.rc
[testenv:cover]
basepython = python2.7

View File

@ -18,6 +18,10 @@ deps =
whitelist_externals =
bash
passenv =
XDG_CACHE_HOME
[testenv:bashate]
# Treat all E* codes as Errors rather than warnings using: -e 'E*'
commands =