zuul: fix and update the jobs, port a legacy one

- port the legacy Tempest job to Zuul v3;
- remove the old py27* environment from the default
  tox list;
- remove the py27 job and add the py38 one (including
  the required tox environment);
- bump tox minversion so that ignore_basepython_conflict
  can be used;
- fix the compatibility with mysql 8 (no more user creation
  with the GRANT statement).

Change-Id: I87be8cb0857a2d83182b4943a11c8bc2191c4b1a
This commit is contained in:
Luigi Toscano 2020-10-09 00:38:09 +02:00
parent 5d1f322542
commit ac0bf8bc61
5 changed files with 15 additions and 91 deletions

View File

@ -1,37 +1,20 @@
- project:
templates:
- docs-on-readthedocs
- openstack-python-jobs
- openstack-python35-jobs
- openstack-python36-jobs
- openstack-python38-jobs
vars:
rtd_webhook_id: '61274'
check:
jobs:
- sqlalchemy-migrate-tox-py27sa07
- sqlalchemy-migrate-devstack:
- sqlalchemy-migrate-tempest-full:
voting: false
gate:
jobs:
- sqlalchemy-migrate-tox-py27sa07
- job:
name: sqlalchemy-migrate-tox-py27sa07
parent: tox
description: |
Run tests for sqlalchemy-migrate project.
Uses tox with the ``py27sa07`` environment.
vars:
tox_envlist: py27sa07
- job:
name: sqlalchemy-migrate-devstack
parent: legacy-dsvm-base
run: playbooks/sqlalchemy-migrate-devstack-dsvm/run.yaml
post-run: playbooks/sqlalchemy-migrate-devstack-dsvm/post.yaml
name: sqlalchemy-migrate-tempest-full
parent: tempest-full-py3
timeout: 10800
required-projects:
- openstack/devstack
- openstack/devstack-gate
- x/sqlalchemy-migrate
- opendev.org/openstack/tempest
- opendev.org/x/sqlalchemy-migrate

View File

@ -1,15 +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=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@ -1,49 +0,0 @@
- hosts: all
name: Autoconverted job legacy-sqlalchemy-migrate-devstack-dsvm from old job gate-sqlalchemy-migrate-devstack-dsvm-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
export PYTHONUNBUFFERED=true
export PROJECTS="x/sqlalchemy-migrate $PROJECTS"
export DEVSTACK_GATE_TEMPEST=1
export DEVSTACK_GATE_TEMPEST_FULL=1
export BRANCH_OVERRIDE=default
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
function pre_test_hook {
cd /opt/stack/new/sqlalchemy-migrate
sudo -H pip install .
}
export -f pre_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

@ -23,8 +23,8 @@ sudo -H mysqladmin -u root password $DB_ROOT_PW
sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e "
DELETE FROM mysql.user WHERE User='';
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.*
TO '$DB_USER'@'%' identified by '$DB_PW' WITH GRANT OPTION;"
CREATE USER '$DB_USER'@'%' IDENTIFIED BY '$DB_PW';
GRANT ALL PRIVILEGES ON *.* TO '$DB_USER'@'%' WITH GRANT OPTION;"
# Now create our database.
mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e "

View File

@ -1,7 +1,8 @@
[tox]
minversion = 1.6
minversion = 3.1.1
skipsdist = True
envlist = py27,py27sa07,py27sa08,py27sa09,py33,py34,py35,py36,pep8
envlist = py35,py36,py38,pep8
ignore_basepython_conflict = True
[testenv]
usedevelop = True
@ -48,6 +49,10 @@ deps = sqlalchemy>=0.9
deps = sqlalchemy>=0.9
-r{toxinidir}/test-requirements.txt
[testenv:py38]
deps = sqlalchemy>=0.9
-r{toxinidir}/test-requirements.txt
[testenv:pep8]
commands = flake8