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 }}'