From 6737c490529163df926f4c48f36b20448003e65d Mon Sep 17 00:00:00 2001 From: "Reed, Joshua" Date: Wed, 13 Dec 2023 13:40:09 -0700 Subject: [PATCH] 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: 49254 Change-Id: I4def40c3f4304196b6a64cf88c8929687bef2fea Signed-off-by: Reed, Joshua --- .gitignore | 2 ++ .zuul.yaml | 21 +++++++++++++++++++ .../k8sapp_kubevirt/tox.ini | 8 +++++++ stx-kubevirt-app-helm/debian/deb_folder/rules | 6 +++--- .../stx-kubevirt-app-helm/files/metadata.yaml | 6 +++--- tox.ini | 4 ++++ 6 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f51ee66 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.tox +venv/ \ No newline at end of file diff --git a/.zuul.yaml b/.zuul.yaml index 469e784..393453f 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -8,12 +8,14 @@ - k8sapp-kubevirt-tox-py39 - k8sapp-kubevirt-tox-flake8 - k8sapp-kubevirt-tox-pylint + - k8sapp-kubevirt-tox-metadata gate: jobs: - openstack-tox-linters - k8sapp-kubevirt-tox-py39 - k8sapp-kubevirt-tox-flake8 - k8sapp-kubevirt-tox-pylint + - k8sapp-kubevirt-tox-metadata - job: name: k8sapp-kubevirt-tox-py39 @@ -46,6 +48,25 @@ tox_envlist: flake8 tox_extra_args: -c python3-k8sapp-kubevirt/k8sapp_kubevirt/tox.ini +- job: + name: k8sapp-kubevirt-tox-metadata + parent: tox + description: | + Run metadata test for k8sapp_kubevirt + required-projects: + - starlingx/config + - starlingx/fault + - starlingx/root + - starlingx/update + - starlingx/utilities + nodeset: debian-bullseye + files: + - python3-k8sapp-kubevirt/* + vars: + tox_envlist: metadata + tox_extra_args: -c python3-k8sapp-kubevirt/k8sapp_kubevirt/tox.ini + tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt' + - job: name: k8sapp-kubevirt-tox-pylint parent: tox diff --git a/python3-k8sapp-kubevirt/k8sapp_kubevirt/tox.ini b/python3-k8sapp-kubevirt/k8sapp_kubevirt/tox.ini index 1a2af7c..3dc9c5f 100644 --- a/python3-k8sapp-kubevirt/k8sapp_kubevirt/tox.ini +++ b/python3-k8sapp-kubevirt/k8sapp_kubevirt/tox.ini @@ -139,3 +139,11 @@ commands = deps = pip_missing_reqs -rrequirements.txt commands=pip-missing-reqs -d k8sapp_kubevirt + +[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" diff --git a/stx-kubevirt-app-helm/debian/deb_folder/rules b/stx-kubevirt-app-helm/debian/deb_folder/rules index 46695d0..4584719 100644 --- a/stx-kubevirt-app-helm/debian/deb_folder/rules +++ b/stx-kubevirt-app-helm/debian/deb_folder/rules @@ -26,9 +26,9 @@ override_dh_auto_build: mkdir -p $(STAGING)/charts 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 cp /plugins/*.whl $(STAGING)/plugins diff --git a/stx-kubevirt-app-helm/stx-kubevirt-app-helm/files/metadata.yaml b/stx-kubevirt-app-helm/stx-kubevirt-app-helm/files/metadata.yaml index a7c8c4c..3fef7d8 100644 --- a/stx-kubevirt-app-helm/stx-kubevirt-app-helm/files/metadata.yaml +++ b/stx-kubevirt-app-helm/stx-kubevirt-app-helm/files/metadata.yaml @@ -1,6 +1,6 @@ -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 maintain_user_overrides: true upgrades: diff --git a/tox.ini b/tox.ini index 2d33788..e799b44 100644 --- a/tox.ini +++ b/tox.ini @@ -51,6 +51,10 @@ description = Dummy environment to allow pylint to be run in subdir tox 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