David Barbosa Bastos eb5039ce29 Remove unit test class HelmOperatorTestSuiteMixin
The purpose of this change is to remove the
HelmOperatorTestSuiteMixin in the unit tests. This reference is
part of Armada and crashes Zuul because it was removed
here: https://review.opendev.org/c/starlingx/config/+/869094

It was necessary to make adjustments to configuration files for unit
tests and pylint because zuul was failing.

Test Plan:
PASS build-pkgs -p python3-k8sapp-oran-o2
PASS build-pkgs -p stx-oran-o2-helm
PASS unit test is performed successfully

Story: 2010560
Task: 48751

Co-Authored-By: Igor Pires Soares <igor.piressoares@windriver.com>
Change-Id: Idb0963c60f8a8a5ec3acd139f60383a128dc43b7
Signed-off-by: David Barbosa Bastos <david.barbosabastos@windriver.com>
2023-09-15 14:57:14 -03:00

123 lines
3.3 KiB
INI

[tox]
envlist = flake8,py39,pylint,bandit
minversion = 1.6
# disable source dist generation because Zuul fails on setting up
# pbr randomly in the sdist step.
skipsdist = True
# tox does not work if the path to the workdir is too long, so move it to /tmp
toxworkdir = /tmp/{env:USER}_k8sapp_oran_o2tox
stxdir = {toxinidir}/../../..
distshare={toxworkdir}/.tox/distshare
[testenv]
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 = False
# tox is silly... these need to be separated by a newline....
allowlist_externals = bash
find
install_command = pip install \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
# Note the hash seed is set to 0 until can be tested with a
# random hash seed successfully.
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
PYTHONDONTWRITEBYTECODE=1
OS_TEST_PATH=./k8sapp_oran_o2/tests
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
EVENTS_YAML=./k8sapp_oran_o2/tests/events_for_testing.yaml
SYSINV_TEST_ENV=True
TOX_WORK_DIR={toxworkdir}
PYLINTHOME={toxworkdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[tox]stxdir}/config/tsconfig/tsconfig
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
-e{[tox]stxdir}/fault/fm-api/source
-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
[flake8]
exclude = build,dist,tools,.eggs
max-line-length=120
[testenv:flake8]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
flake8-bugbear
commands =
flake8 {posargs} .
[testenv:py39]
basepython = python3.9
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:pep8]
# testenv:flake8 clone
basepython = {[testenv:flake8]basepython}
deps = {[testenv:flake8]deps}
commands = {[testenv:flake8]commands}
[testenv:venv]
commands = {posargs}
[bandit]
[testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
bandit
commands = bandit --ini tox.ini -n 5 -r k8sapp_oran_o2
[testenv:pylint]
basepython = python3
commands =
pylint {posargs} k8sapp_oran_o2 --rcfile=./pylint.rc
[testenv:cover]
basepython = python3
deps = {[testenv]deps}
setenv = {[testenv]setenv}
PYTHON=coverage run --parallel-mode
commands =
{[testenv]commands}
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:pip-missing-reqs]
# do not install test-requirements as that will pollute the virtualenv for
# determining missing packages
# this also means that pip-missing-reqs must be installed separately, outside
# of the requirements.txt files
deps = pip_missing_reqs
-rrequirements.txt
commands=pip-missing-reqs -d --ignore-file=/k8sapp_oran_o2/tests k8sapp_oran_o2