Convert legacy-tox-with-sudo-snap

Convert legacy-tox-with-sudo-snap to Zuul v3 native job, update the
template using it and move it to project-templates.

Change-Id: Ib1350c60d0de2d41c2d1bc56ba2083068e70db76
This commit is contained in:
Andreas Jaeger 2018-01-19 13:08:42 +01:00
parent 796a7e8d72
commit 753655e91d
6 changed files with 26 additions and 153 deletions

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

View File

@ -1,68 +0,0 @@
- hosts: all
name: Autoconverted job legacy-tox-with-sudo-snap from old job gate-{name}-tox-with-sudo-snap
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
CLONEMAP=`mktemp`
REQS_DIR=`mktemp -d`
function cleanup {
mkdir -p $WORKSPACE
rm -rf $CLONEMAP $REQS_DIR
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
# zuul cloner works poorly if there are 2 names that are the
# same in here.
if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then
cat >> $CLONEMAP << EOF
- name: openstack/requirements
dest: $REQS_DIR
EOF
fi
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT openstack/requirements
# REQS_DIR is not set for openstack/requirements and there is also
# no need to copy in this case.
if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then
cp $REQS_DIR/upper-constraints.txt ./
fi
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: /usr/local/jenkins/slave_scripts/run-tox.sh snap
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
OUT=`git ls-files --other --exclude-standard --directory`
if [ -z "$OUT" ]; then
echo "No extra files created during test."
exit 0
else
echo "The following un-ignored files were created during the test:"
echo "$OUT"
exit 0 # TODO: change to 1 to fail tests.
fi
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -429,6 +429,21 @@
vars:
tox_envlist: compare-cover
- job:
name: openstack-tox-snap-with-sudo
parent: openstack-tox-with-sudo
description: |
Run tox-based functional tests for an OpenStack Python project.
Uses tox with the ``snap`` environment.
Sudo access is not revoked.
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
vars:
tox_envlist: snap
- job:
name: build-openstack-puppet-tarball
description: |

View File

@ -839,3 +839,14 @@
post:
jobs:
- publish-openstack-python-branch-tarball
- project-template:
name: snap-jobs
description: |
Run tests for snap repositories.
check:
jobs:
- openstack-tox-snap-with-sudo
gate:
jobs:
- openstack-tox-snap-with-sudo

View File

@ -5114,15 +5114,6 @@
- openstack/devstack-plugin-zmq
- openstack/tempest
- job:
name: legacy-tox-with-sudo-snap
parent: legacy-base
run: playbooks/legacy/tox-with-sudo-snap/run.yaml
post-run: playbooks/legacy/tox-with-sudo-snap/post.yaml
timeout: 2400
required-projects:
- openstack/requirements
- job:
name: legacy-tricircle-dsvm-functional
parent: legacy-dsvm-base

View File

@ -376,12 +376,3 @@
post:
jobs:
- publish-openstack-python-branch-tarball
- project-template:
name: snap-jobs
check:
jobs:
- legacy-tox-with-sudo-snap
gate:
jobs:
- legacy-tox-with-sudo-snap