From c9de308d00c96c788e7d887cc77c3ed4b490b7f5 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Sun, 25 Feb 2018 07:24:59 -0500 Subject: [PATCH] Add osc-placement-dsvm-functional-py3 job This adds a py3 variant of the functional dsvm job. This still uses devstack-gate (not native zuulv3) because I'm not yet cool enough to know how to do native zuulv3 things. Swift has to be disabled since it doesn't support py3 (this is something all other py3 jobs are doing right now too). Change-Id: I9a0074d9658eab76b7c73b820f498d61b89545e7 --- .zuul.yaml | 15 ++++ .../post.yaml | 81 +++++++++++++++++++ .../run.yaml | 61 ++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 playbooks/legacy/osc-placement-dsvm-functional-py3/post.yaml create mode 100644 playbooks/legacy/osc-placement-dsvm-functional-py3/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml index f0ca43b..225b871 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -8,10 +8,25 @@ - openstack-infra/devstack-gate - openstack/osc-placement +- job: + name: osc-placement-dsvm-functional-py3 + parent: legacy-dsvm-base + description: | + Runs the osc-placement functional tests in a python 3 devstack + environment. + run: playbooks/legacy/osc-placement-dsvm-functional-py3/run.yaml + post-run: playbooks/legacy/osc-placement-dsvm-functional-py3/post.yaml + timeout: 7200 + required-projects: + - openstack-infra/devstack-gate + - openstack/osc-placement + - project: check: jobs: - osc-placement-dsvm-functional + - osc-placement-dsvm-functional-py3 gate: jobs: - osc-placement-dsvm-functional + - osc-placement-dsvm-functional-py3 diff --git a/playbooks/legacy/osc-placement-dsvm-functional-py3/post.yaml b/playbooks/legacy/osc-placement-dsvm-functional-py3/post.yaml new file mode 100644 index 0000000..bf7fd10 --- /dev/null +++ b/playbooks/legacy/osc-placement-dsvm-functional-py3/post.yaml @@ -0,0 +1,81 @@ +- hosts: primary + tasks: + + # TODO(mriedem): Need to cleanup these 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/osc-placement-dsvm-functional-py3/run.yaml b/playbooks/legacy/osc-placement-dsvm-functional-py3/run.yaml new file mode 100644 index 0000000..0ad9b68 --- /dev/null +++ b/playbooks/legacy/osc-placement-dsvm-functional-py3/run.yaml @@ -0,0 +1,61 @@ +- hosts: all + name: osc-placement-dsvm-functional-py3 + 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 + cat << 'EOF' >>"/tmp/dg-local.conf" + [[local|localrc]] + # swift is not ready for python3 yet + disable_service s-account + disable_service s-container + disable_service s-object + disable_service s-proxy + + EOF + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + export PYTHONUNBUFFERED=true + export DEVSTACK_PROJECT_FROM_GIT=osc-placement + export DEVSTACK_GATE_USE_PYTHON3=True + + function post_test_hook { + # Configure and run functional tests + $BASE/new/osc-placement/osc_placement/tests/functional/hooks/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 }}'