From b73d66e166a6ad64398423e7308006b0d61464f4 Mon Sep 17 00:00:00 2001 From: Idan Hefetz Date: Tue, 5 Jun 2018 11:39:49 +0000 Subject: [PATCH] Add a new tempest job with a mock datasource In this tempest job, the mock datasource is used to create an entity graph with ~20,000 vertices. This job will contain tests for init procedure, processes, restarts, multiple api calls. Other data sources are disabled. Heat, Telemetry, Mistral are not installed. Depends-On: I9c4c329983bbe5930de5484fa6932b318746ed5c Depends-On: Ice708f4aaf6132e4e8a7ae6352112f8b563b95b8 Change-Id: I6fd5c70efa6f722461d36c1cd1aa94352e6e4596 --- .zuul.yaml | 37 +++++++++ devstack/gate_hook_mock.sh | 70 ++++++++++++++++ .../legacy/vitrage-dsvm-mock-py27/post.yaml | 80 +++++++++++++++++++ .../legacy/vitrage-dsvm-mock-py27/run.yaml | 51 ++++++++++++ .../legacy/vitrage-dsvm-mock-py35/post.yaml | 80 +++++++++++++++++++ .../legacy/vitrage-dsvm-mock-py35/run.yaml | 51 ++++++++++++ 6 files changed, 369 insertions(+) create mode 100644 devstack/gate_hook_mock.sh create mode 100644 playbooks/legacy/vitrage-dsvm-mock-py27/post.yaml create mode 100644 playbooks/legacy/vitrage-dsvm-mock-py27/run.yaml create mode 100644 playbooks/legacy/vitrage-dsvm-mock-py35/post.yaml create mode 100644 playbooks/legacy/vitrage-dsvm-mock-py35/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml index e65c1e421..b6f452c69 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -3,10 +3,13 @@ jobs: - vitrage-dsvm-api-py27 - vitrage-dsvm-datasources-py27 + - vitrage-dsvm-mock-py27 - vitrage-dsvm-api-py35: branches: ^(?!stable/(newton|ocata|pike)).*$ - vitrage-dsvm-datasources-py35: branches: ^(?!stable/(newton|ocata|pike)).*$ + - vitrage-dsvm-mock-py35: + branches: ^(?!stable/(newton|ocata|pike)).*$ - openstack-tox-lower-constraints gate: jobs: @@ -87,3 +90,37 @@ - ^.*\.rst$ - ^doc/.*$ - ^releasenotes/.*$ + +- job: + name: vitrage-dsvm-mock-py27 + parent: legacy-dsvm-base + voting: false + run: playbooks/legacy/vitrage-dsvm-mock-py27/run.yaml + post-run: playbooks/legacy/vitrage-dsvm-mock-py27/post.yaml + timeout: 7800 + required-projects: + - openstack-infra/devstack-gate + - openstack/python-vitrageclient + - openstack/vitrage + - openstack/vitrage-tempest-plugin + irrelevant-files: + - ^.*\.rst$ + - ^doc/.*$ + - ^releasenotes/.*$ + +- job: + name: vitrage-dsvm-mock-py35 + parent: legacy-dsvm-base + voting: false + run: playbooks/legacy/vitrage-dsvm-mock-py35/run.yaml + post-run: playbooks/legacy/vitrage-dsvm-mock-py35/post.yaml + timeout: 7800 + required-projects: + - openstack-infra/devstack-gate + - openstack/python-vitrageclient + - openstack/vitrage + - openstack/vitrage-tempest-plugin + irrelevant-files: + - ^.*\.rst$ + - ^doc/.*$ + - ^releasenotes/.*$ diff --git a/devstack/gate_hook_mock.sh b/devstack/gate_hook_mock.sh new file mode 100644 index 000000000..b7b3f509d --- /dev/null +++ b/devstack/gate_hook_mock.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +# Copyright 2018 - Nokia +# +# 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. + +export DEVSTACK_GATE_INSTALL_TESTONLY=1 +export DEVSTACK_GATE_TEMPEST=1 +export DEVSTACK_GATE_TEMPEST_NOTESTS=1 +export KEEP_LOCALRC=1 + +DEVSTACK_LOCAL_CONFIG+=$'\nenable_plugin vitrage git://git.openstack.org/openstack/vitrage' +DEVSTACK_LOCAL_CONFIG+=$'\nenable_plugin vitrage-tempest-plugin git://git.openstack.org/openstack/vitrage-tempest-plugin' + +# we don't want swift +DEVSTACK_LOCAL_CONFIG+=$'\ndisable_service s-account s-container s-object s-proxy' + +DEVSTACK_LOCAL_CONFIG+="$(cat < clonemap.yaml << EOF + clonemap: + - name: openstack-infra/devstack-gate + dest: devstack-gate + EOF + /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ + git://git.openstack.org \ + openstack-infra/devstack-gate + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + export PYTHONUNBUFFERED=true + export PROJECTS="openstack/python-vitrageclient $PROJECTS" + export PROJECTS="openstack/vitrage $PROJECTS" + export PROJECTS="openstack/vitrage-tempest-plugin $PROJECTS" + + export DEVSTACK_GATE_USE_PYTHON3=False + + function gate_hook { + source $BASE/new/vitrage/devstack/gate_hook_mock.sh + } + export -f gate_hook + + function post_test_hook { + source $BASE/new/vitrage-tempest-plugin/devstack/post_test_hook.sh 'mock' + } + 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 }}' diff --git a/playbooks/legacy/vitrage-dsvm-mock-py35/post.yaml b/playbooks/legacy/vitrage-dsvm-mock-py35/post.yaml new file mode 100644 index 000000000..dac875340 --- /dev/null +++ b/playbooks/legacy/vitrage-dsvm-mock-py35/post.yaml @@ -0,0 +1,80 @@ +- 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=**/*nose_results.html + - --include=*/ + - --exclude=* + - --prune-empty-dirs + + - 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=**/*testr_results.html.gz + - --include=*/ + - --exclude=* + - --prune-empty-dirs + + - 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=/.testrepository/tmp* + - --include=*/ + - --exclude=* + - --prune-empty-dirs + + - 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=**/*testrepository.subunit.gz + - --include=*/ + - --exclude=* + - --prune-empty-dirs + + - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + synchronize: + src: '{{ ansible_user_dir }}/workspace/' + dest: '{{ zuul.executor.log_root }}/tox' + mode: pull + copy_links: true + verify_host: true + rsync_opts: + - --include=/.tox/*/log/* + - --include=*/ + - --exclude=* + - --prune-empty-dirs + + - 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/legacy/vitrage-dsvm-mock-py35/run.yaml b/playbooks/legacy/vitrage-dsvm-mock-py35/run.yaml new file mode 100644 index 000000000..74e3240aa --- /dev/null +++ b/playbooks/legacy/vitrage-dsvm-mock-py35/run.yaml @@ -0,0 +1,51 @@ +- hosts: all + name: Autoconverted job legacy-vitrage-dsvm-mock-py35 from old job gate-vitrage-dsvm-mock-py35-ubuntu-xenial-nv + 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-infra/devstack-gate + dest: devstack-gate + EOF + /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ + git://git.openstack.org \ + openstack-infra/devstack-gate + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + export PYTHONUNBUFFERED=true + export PROJECTS="openstack/python-vitrageclient $PROJECTS" + export PROJECTS="openstack/vitrage $PROJECTS" + export PROJECTS="openstack/vitrage-tempest-plugin $PROJECTS" + + export DEVSTACK_GATE_USE_PYTHON3=True + + function gate_hook { + source $BASE/new/vitrage/devstack/gate_hook_mock.sh + } + export -f gate_hook + + function post_test_hook { + source $BASE/new/vitrage-tempest-plugin/devstack/post_test_hook.sh 'mock' + } + 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 }}'