monitoring/kube-memory/kube-memory/tox.ini
Al Bailey 9c48ac6611 Remove python2 jobs from zuul for this repo
- Remove the python2 jobs from zuul for this repo
 - Remove python2 entries from test-requirements and tox
 - Removed redundant basepython and other tox.ini entries
 - Updated the upper constraints for the newer python
 - Fix the test-requirements so 'cover' can run
 - Update .gitignore to show a clean repo after running tox
 - Added prettytable to the requirements files
 - Updated the versions of python in setup.cfg

These changes should only affect tox and zuul.
However, since the requirements.txt files were updated, an
ISO was also booted to verify no runtime impact.

Test Plan:
  PASS: Build packages and ISO
  PASS: Boot AIO-SX, bootstrap and unlocked.
  PASS: tox (able to run tox for all 3 tox.ini files)
  PASS: run kube-memory and kube-cpusets on controller

Story: 2010642
Task: 47882
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I4359f3659e75ddfda4208524a6b74360dfe5ee0c
2023-04-28 18:24:13 +00:00

88 lines
2.3 KiB
INI

#
# Copyright (c) 2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
[tox]
envlist = flake8,py39,pylint,cover
minversion = 2.3.2
skipsdist = True
stxdir = {toxinidir}/../../..
[testenv]
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
OS_STDERR_CAPTURE=1
OS_STDOUT_CAPTURE=1
OS_TEST_PATH=./kube_memory/tests
OS_TEST_TIMEOUT=60
PYTHONDONTWRITEBYTECODE=1
PYTHONHASHSEED=0
PYTHONWARNINGS=default::DeprecationWarning
PIP_DISABLE_PIP_VERSION_CHECK=1
basepython = python3
passenv =
XDG_CACHE_HOME
sitepackages = False
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}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[tox]stxdir}/config/tsconfig/tsconfig
allowlist_externals = find
sh
[testenv:stestr]
commands =
find . -name "*.pyc" -delete
stestr run {posargs}
stestr slowest
[testenv:py39]
basepython = python3.9
commands = {[testenv:stestr]commands}
[bandit]
exclude = tests
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
bandit
commands = bandit --ini tox.ini -n 5 -r kube_memory
[flake8]
show-source = True
ignore =
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
# H106: Don't put vim configuration in source files (off by default).
# H203: Use assertIs(Not)None to check for None (off by default).
# enable: H904 Delay string interpolations at logging calls (off by default).
enable-extensions = H106 H203 H904
max-line-length = 120
[testenv:flake8]
deps = {[testenv]deps}
flake8-bugbear
usedevelop = False
#skip_install = True
commands =
flake8 {posargs} .
[testenv:pylint]
deps = {[testenv]deps}
pylint
commands = pylint kube_memory --rcfile=./pylint.rc
[testenv:cover]
setenv =
PYTHON=coverage run --parallel-mode
PYTHONDONTWRITEBYTECODE=True
commands = coverage erase
find . -name "*.pyc" -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report