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 ee603f1..2bb15b0 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -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 diff --git a/python3-k8sapp-intel-ethernet-operator/k8sapp_intel_ethernet_operator/tox.ini b/python3-k8sapp-intel-ethernet-operator/k8sapp_intel_ethernet_operator/tox.ini index e92e8fb..022ef63 100644 --- a/python3-k8sapp-intel-ethernet-operator/k8sapp_intel_ethernet_operator/tox.ini +++ b/python3-k8sapp-intel-ethernet-operator/k8sapp_intel_ethernet_operator/tox.ini @@ -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" \ No newline at end of file diff --git a/stx-intel-ethernet-operator-helm/debian/deb_folder/rules b/stx-intel-ethernet-operator-helm/debian/deb_folder/rules index cd84026..c416643 100644 --- a/stx-intel-ethernet-operator-helm/debian/deb_folder/rules +++ b/stx-intel-ethernet-operator-helm/debian/deb_folder/rules @@ -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 diff --git a/stx-intel-ethernet-operator-helm/stx-intel-ethernet-operator-helm/files/metadata.yaml b/stx-intel-ethernet-operator-helm/stx-intel-ethernet-operator-helm/files/metadata.yaml index e3943c3..3e239ee 100644 --- a/stx-intel-ethernet-operator-helm/stx-intel-ethernet-operator-helm/files/metadata.yaml +++ b/stx-intel-ethernet-operator-helm/stx-intel-ethernet-operator-helm/files/metadata.yaml @@ -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 diff --git a/tox.ini b/tox.ini index 031e6c8..feb7435 100644 --- a/tox.ini +++ b/tox.ini @@ -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 -