From 303598289ddf56a9b4223487b4f8f382ccb350c4 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Sat, 16 Mar 2019 10:11:29 +0100 Subject: [PATCH] Switch neutron-functional-with-wsgi job to zuul v3 syntax This patch removes also legacy playbooks used before by this experimental job and it also removes neutron/tests/contrib/post_test_hook.sh script as it was used only by functional and fullstack tests and it's not used anymore. Change-Id: Ibc48ce8e80e11dcbb13da121aa86bbf01b98a3d9 Related-Bug: #1804844 --- .zuul.yaml | 16 +--- .../policies/gate-failure-triage.rst | 12 +-- neutron/tests/contrib/post_test_hook.sh | 71 ---------------- .../neutron-functional-with-uwsgi/post.yaml | 80 ------------------- .../neutron-functional-with-uwsgi/run.yaml | 67 ---------------- 5 files changed, 10 insertions(+), 236 deletions(-) delete mode 100644 neutron/tests/contrib/post_test_hook.sh delete mode 100644 playbooks/legacy/neutron-functional-with-uwsgi/post.yaml delete mode 100644 playbooks/legacy/neutron-functional-with-uwsgi/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 3c042d3a701..f4088401d74 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -418,18 +418,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: diff --git a/doc/source/contributor/policies/gate-failure-triage.rst b/doc/source/contributor/policies/gate-failure-triage.rst index eb6ec56547b..b528062f84c 100644 --- a/doc/source/contributor/policies/gate-failure-triage.rst +++ b/doc/source/contributor/policies/gate-failure-triage.rst @@ -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 diff --git a/neutron/tests/contrib/post_test_hook.sh b/neutron/tests/contrib/post_test_hook.sh deleted file mode 100644 index 99059fedf29..00000000000 --- a/neutron/tests/contrib/post_test_hook.sh +++ /dev/null @@ -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 diff --git a/playbooks/legacy/neutron-functional-with-uwsgi/post.yaml b/playbooks/legacy/neutron-functional-with-uwsgi/post.yaml deleted file mode 100644 index dac875340aa..00000000000 --- a/playbooks/legacy/neutron-functional-with-uwsgi/post.yaml +++ /dev/null @@ -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 diff --git a/playbooks/legacy/neutron-functional-with-uwsgi/run.yaml b/playbooks/legacy/neutron-functional-with-uwsgi/run.yaml deleted file mode 100644 index 048d684ea9d..00000000000 --- a/playbooks/legacy/neutron-functional-with-uwsgi/run.yaml +++ /dev/null @@ -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 }}'