Native Zuul v3 port of the legacy functional job

The name of the job now follows the guidelines.
Remove the old scripts which are not needed anymore.

Also, even though OS_TENANT_NAME is still exported,
read OS_PROJECT_NAME as first choice.

Depends-On: https://review.opendev.org/746235
Change-Id: I2d698e4f7c38e010cfef2961446914fff136b181
This commit is contained in:
Luigi Toscano 2020-08-23 00:48:11 +02:00
parent f0e783edcf
commit 921b70fcd6
6 changed files with 28 additions and 215 deletions

View File

@ -1,13 +1,32 @@
- job:
name: senlinclient-dsvm-functional
parent: legacy-dsvm-base
run: playbooks/legacy/senlinclient-dsvm-functional/run.yaml
post-run: playbooks/legacy/senlinclient-dsvm-functional/post.yaml
timeout: 7200
name: senlinclient-functional
parent: devstack-tox-functional
required-projects:
- openstack/devstack-gate
- openstack/python-senlinclient
- openstack/senlin
vars:
openrc_enable_export: true
devstack_plugins:
senlin: https://opendev.org/openstack/senlin
devstack_local_conf:
post-config:
$SENLIN_CONF:
DEFAULT:
cloud_backend: openstack_test
default_log_levels: >-
amqp=WARN,amqplib=WARN,sqlalchemy=WARN,oslo_messaging=WARN
,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN
,urllib3.connectionpool=WARN
,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN
,keystonemiddleware=WARN
,routes.middleware=WARN
,stevedore=WARN
,oslo_messaging._drivers.amqp=WARN
,oslo_messaging._drivers.amqpdriver=WARN
irrelevant-files:
- ^senlinclient/tests/unit/.*$
- ^setup.cfg$
- ^tools/.*$
- project:
templates:
@ -19,5 +38,5 @@
- release-notes-jobs-python3
check:
jobs:
- senlinclient-dsvm-functional:
- senlinclient-functional:
voting: false

View File

@ -1,67 +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.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,71 +0,0 @@
- hosts: all
name: Autoconverted job legacy-senlinclient-dsvm-functional from old job gate-senlinclient-dsvm-functional-nv
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
cat << 'EOF' >>"/tmp/dg-local.conf"
[[local|localrc]]
enable_plugin senlin https://opendev.org/openstack/senlin
enable_service sl-api sl-eng
USE_PYTHON3=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 BRANCH_OVERRIDE=default
export KEEP_LOCALRC=1
export PROJECTS="openstack/senlin $PROJECTS"
export DEVSTACK_PROJECT_FROM_GIT=python-senlinclient
export SENLIN_BACKEND="openstack_test"
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
function pre_test_hook {
cd /opt/stack/new/python-senlinclient/senlinclient/tests/functional/hooks/
./pre_test_hook.sh
}
export -f pre_test_hook
function post_test_hook {
cd /opt/stack/new/python-senlinclient/senlinclient/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 }}'

View File

@ -34,7 +34,8 @@ class OpenStackClientTestBase(base.ClientTestBase):
return base.CLIClient(
username=os.environ.get('OS_USERNAME'),
password=os.environ.get('OS_PASSWORD'),
tenant_name=os.environ.get('OS_TENANT_NAME'),
tenant_name=os.environ.get('OS_PROJECT_NAME',
os.environ.get('OS_TENANT_NAME')),
uri=os.environ.get('OS_AUTH_URL'),
cli_dir=cli_dir)

View File

@ -1,35 +0,0 @@
#!/bin/bash -xe
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# This script is executed inside post_test_hook function in devstack gate.
export SENLINCLIENT_DIR="$BASE/new/python-senlinclient"
source $BASE/new/devstack/openrc admin admin
cd $SENLINCLIENT_DIR
sudo -E chown -R $USER:stack $SENLINCLIENT_DIR
# Run tests
echo "Running senlinclient functional test."
set +e
sudo -E -H -u $USER tox -efunctional
RESULT=$?
set -e
echo "Completed running senlinclient functional test."
exit $RESULT

View File

@ -1,34 +0,0 @@
#!/bin/bash -xe
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# This script is executed inside pre_test_hook function in devstack gate.
export localconf=$BASE/new/devstack/local.conf
export SENLIN_CONF=/etc/senlin/senlin.conf
export SENLIN_BACKEND=${SENLIN_BACKEND:-'openstack_test'}
_LOG_CFG='default_log_levels ='
_LOG_CFG+='amqp=WARN,amqplib=WARN,sqlalchemy=WARN,oslo_messaging=WARN'
_LOG_CFG+=',iso8601=WARN,requests.packages.urllib3.connectionpool=WARN'
_LOG_CFG+=',urllib3.connectionpool=WARN'
_LOG_CFG+=',requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN'
_LOG_CFG+=',keystonemiddleware=WARN'
_LOG_CFG+=',routes.middleware=WARN'
_LOG_CFG+=',stevedore=WARN'
_LOG_CFG+=',oslo_messaging._drivers.amqp=WARN'
_LOG_CFG+=',oslo_messaging._drivers.amqpdriver=WARN'
echo -e '[[post-config|$SENLIN_CONF]]\n[DEFAULT]\n' >> $localconf
echo -e "cloud_backend=$SENLIN_BACKEND\n" >> $localconf
echo -e $_LOG_CFG >> $localconf