Browse Source

Switch functional job to Zuulv3 syntax

This patch switches from legacy job to a Zuul v3 job inheriting from
neutron-functional job definition.

Also cleaning up relevant files for legacy job

Change-Id: I419c98d58637d57c3a2436630dd787b17f9027d5
changes/82/703582/1 16.0.0.0b1
Bernard Cafarelli 2 years ago
parent
commit
fd72823d20
No known key found for this signature in database GPG Key ID: 9531F08245465A52
  1. 22
      .zuul.yaml
  2. 46
      neutron_dynamic_routing/tests/contrib/post_test_hook.sh
  3. 80
      playbooks/neutron-dynamic-routing-dsvm-functional/post.yaml
  4. 57
      playbooks/neutron-dynamic-routing-dsvm-functional/run.yaml

22
.zuul.yaml

@ -1,18 +1,8 @@
- job:
name: neutron-dynamic-routing-dsvm-functional
parent: legacy-dsvm-base
run: playbooks/neutron-dynamic-routing-dsvm-functional/run.yaml
post-run: playbooks/neutron-dynamic-routing-dsvm-functional/post.yaml
timeout: 7800
required-projects:
- openstack/devstack-gate
- openstack/neutron
- openstack/neutron-dynamic-routing
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
name: neutron-dynamic-routing-functional
parent: neutron-functional
vars:
project_name: neutron-dynamic-routing-functional
- project:
templates:
@ -24,11 +14,11 @@
- release-notes-jobs-python3
check:
jobs:
- neutron-dynamic-routing-dsvm-functional
- neutron-dynamic-routing-functional
- neutron-tempest-plugin-dynamic-routing
gate:
jobs:
- neutron-dynamic-routing-dsvm-functional
- neutron-dynamic-routing-functional
- neutron-tempest-plugin-dynamic-routing
periodic:
jobs:

46
neutron_dynamic_routing/tests/contrib/post_test_hook.sh

@ -1,46 +0,0 @@
#!/usr/bin/env bash
set -xe
PROJECT_NAME=neutron-dynamic-routing
GATE_DEST=$BASE/new
NEUTRON_PATH=$GATE_DEST/neutron
DR_PATH=$GATE_DEST/$PROJECT_NAME
SCRIPTS_PATH="/usr/os-testr-env/bin/"
VENV=${1:-"dsvm-functional"}
function generate_testr_results {
# Give job user rights to access tox logs
sudo -H -u $OWNER chmod o+rw .
sudo -H -u $OWNER chmod o+rw -R .stestr
if [ -f ".stestr/0" ] ; then
.tox/$VENV/bin/subunit-1to2 < .stestr/0 > ./stestr.subunit
$SCRIPTS_PATH/subunit2html ./stestr.subunit testr_results.html
gzip -9 ./stestr.subunit
gzip -9 ./testr_results.html
sudo mv ./*.gz /opt/stack/logs/
fi
}
if [[ "$VENV" == dsvm-functional* ]]
then
OWNER=stack
SUDO_ENV=
# Set owner permissions according to job's requirements.
sudo chown -R $OWNER:stack $NEUTRON_PATH
sudo chown -R $OWNER:stack $DR_PATH
cd $DR_PATH
# Run tests
echo "Running $PROJECT_NAME $VENV test suite"
set +e
sudo -H -u $OWNER $SUDO_ENV tox -e $VENV
testr_exit_code=$?
set -e
# Collect and parse results
generate_testr_results
exit $testr_exit_code
fi

80
playbooks/neutron-dynamic-routing-dsvm-functional/post.yaml

@ -1,80 +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=**/*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

57
playbooks/neutron-dynamic-routing-dsvm-functional/run.yaml

@ -1,57 +0,0 @@
- hosts: all
name: Autoconverted job legacy-neutron-dynamic-routing-dsvm-functional from old
job gate-neutron-dynamic-routing-dsvm-functional
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
export DEVSTACK_GATE_USE_PYTHON3=True
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_UNSTACK=1
export DEVSTACK_GATE_TEMPEST=0
export DEVSTACK_GATE_NEUTRON=1
export DEVSTACK_GATE_INSTALL_TESTONLY=1
export BRANCH_OVERRIDE=default
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
export PROJECTS="openstack/neutron-dynamic-routing $PROJECTS"
function gate_hook {
bash -xe $BASE/new/neutron-dynamic-routing/neutron_dynamic_routing/tests/contrib/gate_hook.sh dsvm-functional
}
export -f gate_hook
function post_test_hook {
bash -xe $BASE/new/neutron-dynamic-routing/neutron_dynamic_routing/tests/contrib/post_test_hook.sh dsvm-functional
}
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 }}'
Loading…
Cancel
Save