Enable py39 tox gate/test for app plugins

Add support for tox testing under Debian Bullseye by enabling a
python 3.9 gate and tox target for exercising plugin unit tests.

Story: 2009101
Task: 43188

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: Ie7f0f4efd809fafb95a14274c400e7cb2f8458b9
This commit is contained in:
Charles Short 2021-09-02 13:54:14 -04:00
parent c6c16c0682
commit 75694acecc
5 changed files with 56 additions and 7 deletions

View File

@ -3,13 +3,32 @@
check:
jobs:
- openstack-tox-linters
- k8app-snmp-armada-tox-py39
gate:
jobs:
- openstack-tox-linters
- k8app-snmp-armada-tox-py39
post:
jobs:
- stx-snmp-armada-app-upload-git-mirror
- job:
name: k8app-snmp-armada-tox-py39
parent: tox-py39
description: |
Run py39 test for k8app-snmp-armada-app
nodeset: debian-bullseye
required-projects:
- starlingx/config
- starlingx/fault
- starlingx/update
- starlingx/utilities
files:
- python-k8sapp-snmp/k8sapp_snmp/*
vars:
tox_envlist: py39
python_version: 3.9
tox_extra_args: python-k8sapp-snmp/k8sapp_snmp/tox.ini
- job:
name: stx-snmp-armada-app-upload-git-mirror
parent: upload-git-mirror
@ -100,4 +119,4 @@
Zbi+hbm/Cfzd8/hCnIQbG7LSi0kAiNSgM9pcU2J3qcivIL7ArpjOrYR+qTa4BraGcqumM
oCrQPmkGGbtEjqD1r7GUHUaUUU2EnCv+qfXF2+GqV3VruRP0X/WWbLmfKYjLgDn3tY5nM
PFo3bmC7D9aU2vHRefTIu0XPpg7VqGTaPIPngkpp71rwlc8s+Kskt/it3o6ZtQNsSna5+
YrbCChy6nCnzWhPeNtAGlRzfSkMYJig98fgEC6wgOexmN6cUYGR7Q0pt/o0Ct0=
YrbCChy6nCnzWhPeNtAGlRzfSkMYJig98fgEC6wgOexmN6cUYGR7Q0pt/o0Ct0=

10
bindep.txt Normal file
View File

@ -0,0 +1,10 @@
# This is a cross-platform list tracking distribution packages needed for install and tests;
# see https://docs.openstack.org/infra/bindep/ for additional information.
libffi-dev [platform:dpkg]
libldap2-dev [platform:dpkg]
libxml2-dev [platform:dpkg]
libxslt1-dev [platform:dpkg]
libsasl2-dev [platform:dpkg]
libffi-devel [platform:rpm]
python3-all-dev [platform:dpkg]

View File

@ -1,4 +1,4 @@
[DEFAULT]
test_path=./k8sapp_cert_manager/tests
top_dir=./k8sapp_cert_manager
test_path=./k8sapp_snmp/tests
top_dir=./k8sapp_snmp
#parallel_class=True

View File

@ -4,6 +4,10 @@
# SPDX-License-Identifier: Apache-2.0
#
import mock
from k8sapp_snmp.helm.snmp import SnmpHelm
from sysinv.common import constants
from sysinv.tests.db import base as dbbase
from sysinv.tests.helm.test_helm import HelmOperatorTestSuiteMixin
@ -15,6 +19,10 @@ class K8SAppSnmpAppMixin(object):
def setUp(self):
super(K8SAppSnmpAppMixin, self).setUp()
get_db_connection = mock.patch.object(SnmpHelm,
'_get_database_connection')
self.mock_save_overrides = get_db_connection.start()
self.addCleanup(get_db_connection.stop)
# Test Configuration:

View File

@ -1,5 +1,5 @@
[tox]
envlist = flake8,py27,py36,pylint,bandit
envlist = flake8,py27,py36,py39,pylint,bandit
minversion = 1.6
# skipsdist = True
#,pip-missing-reqs
@ -14,15 +14,15 @@ distshare={toxworkdir}/.tox/distshare
# 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
# Note. site-packages is false and rpm-python must be yum installed on your dev machine.
sitepackages = False
# tox is silly... these need to be separated by a newline....
whitelist_externals = bash
find
install_command = pip install \
-v -v -v \
-v -v -v --use-deprecated legacy-resolver \
-c{toxinidir}/upper-constraints.txt \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
{opts} {packages}
@ -79,6 +79,18 @@ commands =
stestr run {posargs}
stestr slowest
[testenv:py39]
basepython = python3.9
install_command = pip install \
-v -v -v --use-deprecated legacy-resolver \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:pep8]
# testenv:flake8 clone
basepython = {[testenv:flake8]basepython}