From 14a8a97993c2d0268414e016aa035e0b7154e073 Mon Sep 17 00:00:00 2001 From: "Reed, Joshua" Date: Wed, 13 Dec 2023 09:06:29 -0700 Subject: [PATCH] Follow up to Zuul Job Update for Metadata. Upon investigation, not every app has the same set of checks. Some have flake8 but not pylint or vise versa. Therefore, some effort will be made to attempt to create consitency accross apps while also adding metadata. Add flake8 check. Fix flake8 tox.ini and py file issues. This change set four checks; flake8, pylint, metadata, and py39. Test Plan PASS - Zuul Jobs Pass as expected Story: 2010929 Task: 49230 Change-Id: I6647bc80f8349bbbdc30c7d99760d16c50e2c41f Signed-off-by: Reed, Joshua --- .zuul.yaml | 18 ++++++++++++++++++ .../lifecycle/lifecycle_dell_storage.py | 2 +- .../k8sapp_dell_storage/tox.ini | 4 +--- tox.ini | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 4cbc0b0..fe51209 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -5,12 +5,14 @@ - openstack-tox-linters - k8sapp-dell-storage-tox-py39 - k8sapp-dell-storage-tox-pylint + - k8sapp-dell-storage-tox-flake8 - k8sapp-dell-storage-tox-metadata gate: jobs: - openstack-tox-linters - k8sapp-dell-storage-tox-py39 - k8sapp-dell-storage-tox-pylint + - k8sapp-dell-storage-tox-flake8 - k8sapp-dell-storage-tox-metadata - job: @@ -68,3 +70,19 @@ tox_envlist: pylint tox_extra_args: -c python3-k8sapp-dell-storage/k8sapp_dell_storage/tox.ini tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt' + +- job: + name: k8sapp-dell-storage-tox-flake8 + parent: tox + description: | + Run flake8 test for k8sapp_dell_storage + nodeset: debian-bullseye + required-projects: + - starlingx/config + - starlingx/root + files: + - python3-k8sapp-dell-storage/* + vars: + tox_envlist: flake8 + tox_extra_args: -c python3-k8sapp-dell-storage/k8sapp_dell_storage/tox.ini + tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt' \ No newline at end of file diff --git a/python3-k8sapp-dell-storage/k8sapp_dell_storage/k8sapp_dell_storage/lifecycle/lifecycle_dell_storage.py b/python3-k8sapp-dell-storage/k8sapp_dell_storage/k8sapp_dell_storage/lifecycle/lifecycle_dell_storage.py index b3d877e..7c9823e 100644 --- a/python3-k8sapp-dell-storage/k8sapp_dell_storage/k8sapp_dell_storage/lifecycle/lifecycle_dell_storage.py +++ b/python3-k8sapp-dell-storage/k8sapp_dell_storage/k8sapp_dell_storage/lifecycle/lifecycle_dell_storage.py @@ -86,5 +86,5 @@ class DellStorageAppLifecycleOperator(lifecycle_base.AppLifecycleOperator): "name": i.name, "user_overrides": i.user_overrides, "system_overrides": i.system_overrides - } for i in overrides if i.system_overrides['enabled'] is True ] + } for i in overrides if i.system_overrides['enabled'] is True] return charts diff --git a/python3-k8sapp-dell-storage/k8sapp_dell_storage/tox.ini b/python3-k8sapp-dell-storage/k8sapp_dell_storage/tox.ini index b105515..dc503ea 100644 --- a/python3-k8sapp-dell-storage/k8sapp_dell_storage/tox.ini +++ b/python3-k8sapp-dell-storage/k8sapp_dell_storage/tox.ini @@ -96,9 +96,7 @@ max-line-length=120 [testenv:flake8] deps = -r{toxinidir}/test-requirements.txt commands = - flake8 {posargs} . \ - scripts/manage-partitions \ - scripts/query_pci_id + flake8 {posargs} ./k8sapp_dell_storage [testenv:py39] commands = diff --git a/tox.ini b/tox.ini index 64a2a28..feb7435 100644 --- a/tox.ini +++ b/tox.ini @@ -31,7 +31,7 @@ description = Dummy environment to allow pylint to be run in subdir tox [testenv:metadata] basepython = python3 -description = Dummy environment to allow pylint to be run in subdir tox +description = Dummy environment to allow sysinv-app to be run in subdir tox [testenv:bandit] basepython = python3