Update app Zuul Check Jobs.

Modify code to conform to flake8 and pylint.

Jobs are now flake8, pylint, py39 and metadata.

Test Plan
PASS - All zuul jobs pass as expected.

Story: 2010929
Task: 49247

Change-Id: If24f07356abbe81ecc417fb6122dfbedf8e02956
Signed-off-by: Reed, Joshua <Joshua.Reed@windriver.com>
This commit is contained in:
Reed, Joshua 2023-12-13 11:05:12 -07:00
parent d5cf135877
commit d89bbdc2a1
6 changed files with 54 additions and 23 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.tox
venv/

View File

@ -6,12 +6,14 @@
- k8sapp-intel-ethernet-operator-tox-py39
- k8sapp-intel-ethernet-operator-tox-pylint
- k8sapp-intel-ethernet-operator-tox-flake8
- k8sapp-intel-ethernet-operator-tox-metadata
gate:
jobs:
- openstack-tox-linters
- k8sapp-intel-ethernet-operator-tox-py39
- k8sapp-intel-ethernet-operator-tox-pylint
- k8sapp-intel-ethernet-operator-tox-flake8
- k8sapp-intel-ethernet-operator-tox-metadata
- job:
name: k8sapp-intel-ethernet-operator-tox-py39
@ -32,6 +34,25 @@
tox_extra_args: -c python3-k8sapp-intel-ethernet-operator/k8sapp_intel_ethernet_operator/tox.ini
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
- job:
name: k8sapp-intel-ethernet-operator-tox-metadata
parent: tox
description: |
Run metadata test for k8sapp_intel_ethernet_operator
required-projects:
- starlingx/config
- starlingx/fault
- starlingx/update
- starlingx/utilities
- starlingx/root
nodeset: debian-bullseye
files:
- python3-k8sapp-intel-ethernet-operator/*
vars:
tox_envlist: metadata
tox_extra_args: -c python3-k8sapp-intel-ethernet-operator/k8sapp_intel_ethernet_operator/tox.ini
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
- job:
name: k8sapp-intel-ethernet-operator-tox-pylint
parent: tox

View File

@ -1,5 +1,5 @@
[tox]
envlist = flake8,py39,pylint
envlist = flake8,py39,pylint,metadata
minversion = 1.6
skipsdist = True
@ -16,6 +16,7 @@ usedevelop = True
# tox is silly... these need to be separated by a newline....
allowlist_externals = bash
find
echo
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} \
@ -181,3 +182,11 @@ commands =
deps = pip_missing_reqs
-rrequirements.txt
commands=pip-missing-reqs -d --ignore-file=/k8sapp_intel_ethernet_operator/tests k8sapp_intel_ethernet_operator
[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"

View File

@ -32,9 +32,9 @@ override_dh_auto_build:
cp helm-charts/*.tgz $(STAGING)/charts
# Populate metadata.
sed -i 's/@APP_NAME@/$(APP_NAME)/g' $(STAGING)/metadata.yaml
sed -i 's/@APP_VERSION@/$(APP_VERSION)/g' $(STAGING)/metadata.yaml
sed -i 's/@HELM_REPO@/$(HELM_REPO)/g' $(STAGING)/metadata.yaml
sed -i 's/APP_REPLACE_NAME/$(APP_NAME)/g' $(STAGING)/metadata.yaml
sed -i 's/APP_REPLACE_VERSION/$(APP_VERSION)/g' $(STAGING)/metadata.yaml
sed -i 's/HELM_REPLACE_REPO/$(HELM_REPO)/g' $(STAGING)/metadata.yaml
# Copy the plugins: installed in the buildroot
mkdir -p $(STAGING)/plugins

View File

@ -1,8 +1,8 @@
maintain_user_overrides: true
app_name: @APP_NAME@
app_version: @APP_VERSION@
helm_repo: @HELM_REPO@
app_name: APP_REPLACE_NAME
app_version: APP_REPLACE_VERSION
helm_repo: HELM_REPLACE_REPO
upgrades:
auto_update: true

31
tox.ini
View File

@ -5,10 +5,10 @@ skipsdist = True
sitepackages=False
[testenv]
basepython = python3
install_command = pip install -U \
{opts} {packages} \
-c{env:TOX_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt}
setenv =
VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
@ -21,9 +21,21 @@ deps =
allowlist_externals =
bash
passenv =
XDG_CACHE_HOME
[testenv:flake8]
basepython = python3
description = Dummy environment to allow flake8 to be run in subdir tox
[testenv:pylint]
basepython = python3
description = Dummy environment to allow pylint to be run in subdir tox
[testenv:metadata]
basepython = python3
description = Dummy environment to allow sysinv-app to be run in subdir tox
[testenv:bandit]
basepython = python3
description = Dummy environment to allow bandit to be run in subdir tox
[testenv:bashate]
# Treat all E* codes as Errors rather than warnings using: -e 'E*'
@ -40,16 +52,3 @@ commands =
[testenv:linters]
commands =
{[testenv:bashate]commands}
[testenv:flake8]
basepython = python3
description = Dummy environment to allow flake8 to be run in subdir tox
[testenv:pylint]
basepython = python3
description = Dummy environment to allow pylint to be run in subdir tox
[testenv:bandit]
basepython = python3
description = Dummy environment to allow bandit to be run in subdir tox