From 1f0feb30ccd3b19bc23453d85d3266c85fcf04d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Douglas=20Mendiz=C3=A1bal?= Date: Wed, 29 Jul 2020 15:28:58 +0200 Subject: [PATCH] Zuul: port to native v3 job and add victoria unit tests Port the functional job to the native Zuul v3 format, and remove a few old wrapper scripts which are not needed anymore (the tests can be run locally through `tox -efunctional` as well). Also, switch to the Victoria run time for unit tests. Co-Authored-By: Luigi Toscano Change-Id: Ibce326044c240d6c4e7f1ca3c3ac50a18282a86d --- .zuul.yaml | 16 ++--- functionaltests/post_test_hook.sh | 24 ------- functionaltests/run_tests.sh | 20 ------ .../python-barbicanclient-dsvm/post.yaml | 15 ----- playbooks/python-barbicanclient-dsvm/run.yaml | 64 ------------------- 5 files changed, 8 insertions(+), 131 deletions(-) delete mode 100755 functionaltests/post_test_hook.sh delete mode 100755 functionaltests/run_tests.sh delete mode 100644 playbooks/python-barbicanclient-dsvm/post.yaml delete mode 100644 playbooks/python-barbicanclient-dsvm/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml index fbf99c89..849f57f7 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,25 +1,25 @@ - job: - name: python-barbicanclient-dsvm - parent: legacy-dsvm-base - run: playbooks/python-barbicanclient-dsvm/run.yaml - post-run: playbooks/python-barbicanclient-dsvm/post.yaml + name: python-barbicanclient-tox-functional + parent: devstack-tox-functional timeout: 4200 required-projects: - - openstack/devstack-gate - openstack/barbican - openstack/barbican-tempest-plugin - openstack/python-barbicanclient + vars: + devstack_plugins: + barbican: https://opendev.org/openstack/barbican - project: templates: - check-requirements - openstack-lower-constraints-jobs - - openstack-python3-ussuri-jobs + - openstack-python3-victoria-jobs - openstackclient-plugin-jobs - publish-openstack-docs-pti check: jobs: - - python-barbicanclient-dsvm + - python-barbicanclient-tox-functional gate: jobs: - - python-barbicanclient-dsvm + - python-barbicanclient-tox-functional diff --git a/functionaltests/post_test_hook.sh b/functionaltests/post_test_hook.sh deleted file mode 100755 index d150635c..00000000 --- a/functionaltests/post_test_hook.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This script is executed inside post_test_hook function in devstack gate. - -# Install packages from test-requirements.txt -sudo pip install -r /opt/stack/new/python-barbicanclient/test-requirements.txt - -# Make sure we're running the trunk client before we run the tests -sudo pip install -U /opt/stack/new/python-barbicanclient - -cd /opt/stack/new/python-barbicanclient/functionaltests -sudo ./run_tests.sh diff --git a/functionaltests/run_tests.sh b/functionaltests/run_tests.sh deleted file mode 100755 index 214d0b12..00000000 --- a/functionaltests/run_tests.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# Install test-requirements -pip install -r /opt/stack/new/python-barbicanclient/test-requirements.txt - -echo "Running functional tests on $(python -V)" - -nosetests -v . diff --git a/playbooks/python-barbicanclient-dsvm/post.yaml b/playbooks/python-barbicanclient-dsvm/post.yaml deleted file mode 100644 index e07f5510..00000000 --- a/playbooks/python-barbicanclient-dsvm/post.yaml +++ /dev/null @@ -1,15 +0,0 @@ -- hosts: primary - tasks: - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/logs/** - - --include=*/ - - --exclude=* - - --prune-empty-dirs diff --git a/playbooks/python-barbicanclient-dsvm/run.yaml b/playbooks/python-barbicanclient-dsvm/run.yaml deleted file mode 100644 index d30ce34b..00000000 --- a/playbooks/python-barbicanclient-dsvm/run.yaml +++ /dev/null @@ -1,64 +0,0 @@ -- hosts: all - name: Autoconverted job legacy-python-barbicanclient-dsvm from old job gate-python-barbicanclient-dsvm-ubuntu-xenial - tasks: - - - name: Ensure legacy workspace directory - file: - path: '{{ ansible_user_dir }}/workspace' - state: directory - - - shell: - cmd: | - set -e - set -x - cat > clonemap.yaml << EOF - clonemap: - - name: openstack/devstack-gate - dest: devstack-gate - EOF - /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ - https://opendev.org \ - openstack/devstack-gate - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -e - set -x - cat << 'EOF' >>"/tmp/dg-local.conf" - [[local|localrc]] - enable_plugin barbican https://opendev.org/openstack/barbican - - EOF - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -e - set -x - export PYTHONUNBUFFERED=true - export OVERRIDE_ENABLED_SERVICES=tempest,rabbit,mysql,key - export PROJECTS="openstack/barbican $PROJECTS" - export PROJECTS="openstack/python-barbicanclient $PROJECTS" - export PROJECTS="openstack/barbican-tempest-plugin $PROJECTS" - - function gate_hook { - $BASE/new/barbican/devstack/gate_hook.sh - } - export -f gate_hook - - function post_test_hook { - cd /opt/stack/new/python-barbicanclient/functionaltests - ./post_test_hook.sh - } - export -f post_test_hook - - cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh - ./safe-devstack-vm-gate-wrap.sh - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}'