Merge "Switch neutron-functional-with-wsgi job to zuul v3 syntax"

This commit is contained in:
Zuul 2019-03-23 19:54:41 +00:00 committed by Gerrit Code Review
commit eae30321d5
5 changed files with 10 additions and 236 deletions

View File

@ -423,18 +423,10 @@
- job:
name: neutron-functional-with-uwsgi
parent: legacy-dsvm-base
run: playbooks/legacy/neutron-functional-with-uwsgi/run.yaml
post-run: playbooks/legacy/neutron-functional-with-uwsgi/post.yaml
timeout: 7800
required-projects:
- openstack-infra/devstack-gate
- openstack/neutron
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^neutron/locale/.*$
- ^releasenotes/.*$
parent: neutron-functional
vars:
devstack_localrc:
NEUTRON_DEPLOY_MOD_WSGI: true
voting: false
- job:

View File

@ -92,15 +92,15 @@ This can be done in two ways:
changes as described below:
* Add an iptables rule to accept incoming telnet connections to remote_pdb.
This can be done in the ``neutron/tests/contrib/post_test_hook.sh`` file,
in the proper section according to the test that you want to debug::
This can be done in one of the ansible roles used in the test job.
Like for example in ``neutron/roles/configure_functional_tests`` file
for functional tests::
sudo iptables -I openstack-INPUT -p tcp -m state --state NEW -m tcp --dport 44444 -j ACCEPT
* Increase the ``OS_TEST_TIMEOUT`` value to make the test wait longer when
remote_pdb is active to make debugging easier. This change can also be
done in the ``neutron/tests/contrib/post_test_hook.sh`` file, in the
same section where the iptables rule was added::
done in the ansible role mentioned above::
export OS_TEST_TIMEOUT=999999
@ -108,8 +108,8 @@ This can be done in two ways:
and that cannot be changed from within the job.
* To make it easier to find the IP address of the test node, you should
add a line to the ``neutron/tests/contrib/post_test_hook.sh`` file to
print the IPs configured on the test node. For example::
add to the ansible role so it prints the IPs configured on the test node.
For example::
hostname -I

View File

@ -1,71 +0,0 @@
#!/usr/bin/env bash
set -xe
NEUTRON_DIR="$BASE/new/neutron"
SCRIPTS_DIR="/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_DIR/subunit2html ./stestr.subunit testr_results.html
gzip -9 ./stestr.subunit
gzip -9 ./testr_results.html
sudo mv ./*.gz /opt/stack/logs/
fi
}
function generate_log_index {
local xtrace
xtrace=$(set +o | grep xtrace)
set +o xtrace
# honor job flavors like -python35
case $venv in
*"dsvm-functional"*)
venv="dsvm-functional"
;;
*)
echo "Unrecognized environment $venv".
exit 1
esac
virtualenv /tmp/os-log-merger
/tmp/os-log-merger/bin/pip install -U os-log-merger==1.1.0
files=$(find /opt/stack/logs/$venv-logs -name '*.txt' -o -name '*.log')
# -a3 to truncate common path prefix
# || true to avoid the whole run failure because of os-log-merger crashes and such
# TODO(ihrachys) remove || true when we have more trust in os-log-merger
contents=$(/tmp/os-log-merger/bin/os-log-merger -a3 $files || true)
# don't store DEBUG level messages because they are not very useful,
# and are not indexed by logstash anyway
echo "$contents" | grep -v DEBUG | sudo tee /opt/stack/logs/$venv-index.txt > /dev/null
$xtrace
}
if [[ "$venv" == dsvm-functional* ]]; then
owner=stack
sudo_env=
# Set owner permissions according to job's requirements.
cd $NEUTRON_DIR
sudo chown -R $owner:stack $NEUTRON_DIR
# Run tests
echo "Running neutron $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
generate_log_index
exit $testr_exit_code
fi

View File

@ -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

View File

@ -1,67 +0,0 @@
- hosts: all
name: This is a Neutron Functional test suite running with uwsgi
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]]
NEUTRON_DEPLOY_MOD_WSGI=True
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_GATE_TEMPEST=0
export DEVSTACK_GATE_EXERCISES=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
function gate_hook {
bash -xe $BASE/new/neutron/neutron/tests/contrib/gate_hook.sh dsvm-functional
}
export -f gate_hook
function post_test_hook {
bash -xe $BASE/new/neutron/neutron/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 }}'