
This commit adds the `cstate-management` StarlingX application. Test Plan: PASS: AIO-SX: check whether the application installs successfully. PASS: AIO-DX: check whether the application installs successfully. PASS: AIO-DX: check whether the application is successfully removed and deleted. PASS: AIO-DX: check whether daemonsets and pods are removed on application removal/deletion. PASS: AIO-DX: check whether the namespace is deleted upon application removal/deletion. PASS: check whether `build-image` runs successfully. PASS: check whether label "app.starlingx.io/component" was applied to "cstate-management" namespace on install. Story: 2011105 Task: 50178 Authored-By: Guilherme Santos <guilherme.santos@windriver.com> Co-Authored-By: Vinicius Lobo <vinicius.rochalobo@windriver.com> Change-Id: Ie99a605a81a1d9ccdabba78be4f020ed549c649d Signed-off-by: Guilherme Santos <guilherme.santos@windriver.com>
116 lines
3.5 KiB
INI
116 lines
3.5 KiB
INI
[tox]
|
|
envlist = flake8,py39,pylint,bandit,metadata
|
|
minversion = 1.6
|
|
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_cstate_management_tox
|
|
stxdir = {toxinidir}/../../..
|
|
distshare={toxworkdir}/.tox/distshare
|
|
|
|
[testenv]
|
|
sitepackages = True
|
|
basepython = python3.9
|
|
|
|
allowlist_externals = bash
|
|
find
|
|
echo
|
|
|
|
install_command = pip install -v -v -v \
|
|
-c{toxinidir}/upper-constraints.txt \
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
|
|
{opts} {packages}
|
|
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
PYTHONHASHSEED=0
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
OS_TEST_PATH=./k8sapp_cstate_management/tests
|
|
LANG=en_US.UTF-8
|
|
LANGUAGE=en_US:en
|
|
LC_ALL=C
|
|
SYSINV_TEST_ENV=True
|
|
EVENTS_YAML=./k8sapp_cstate_management/tests/events_for_testing.yaml
|
|
TOX_WORK_DIR={toxworkdir}
|
|
PYLINTHOME={toxworkdir}
|
|
|
|
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/source
|
|
-e{[tox]stxdir}/fault/python-fmclient/fmclient
|
|
-e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient
|
|
-e{[tox]stxdir}/update/sw-patch/cgcs-patch
|
|
|
|
[flake8]
|
|
# H series are hacking
|
|
# H403 multi line docstrings should end on a new line
|
|
# H404 multi line docstring should start without a leading new line
|
|
# H405 multi line docstring summary not separated with an empty line
|
|
ignore = H403,H404,H405,W503,W504
|
|
exclude = build,dist,tools,.eggs
|
|
max-line-length=80
|
|
|
|
[testenv:flake8]
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
flake8 {posargs} .
|
|
|
|
[testenv:py39]
|
|
commands =
|
|
{[testenv]commands}
|
|
stestr run {posargs}
|
|
stestr slowest
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[bandit]
|
|
# The following bandit tests are being skipped:
|
|
# B108: Test for insecure usage of tmp file/directory
|
|
#
|
|
# Note: 'skips' entry cannot be split across multiple lines
|
|
#
|
|
skips = B108
|
|
exclude = tests
|
|
|
|
[testenv:bandit]
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
bandit
|
|
commands = bandit --ini tox.ini -n 5 -r k8sapp_cstate_management
|
|
|
|
[testenv:pylint]
|
|
commands =
|
|
pylint {posargs} k8sapp_cstate_management --rcfile=./pylint.rc
|
|
|
|
[testenv:cover]
|
|
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_cstate_management/tests k8sapp_cstate_management
|
|
|
|
[testenv:metadata]
|
|
install_command = pip install -v -v -v \
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
|
|
{opts} {packages}
|
|
# Pass top level app folder to 'sysinv-app tox' command.
|
|
commands =
|
|
bash -c "echo $(dirname $(dirname $(pwd))) | xargs -n 1 sysinv-app tox" |