interop/tools/consistency.sh
Chris Hoge 497074a1a7 Make consistency job gating.
This patch updates some of the consistency checking tools
to make them more generally usable by allowing both
automatic checkout of tempest and manual checkout. It builds
on this to add a Zuul job that gates against the consistency
check.

Change-Id: Id0d9148af39c2d2ccf8f11502cc9aff6699f0ead
2018-10-03 08:35:49 -05:00

41 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# This script will run consistency checks for Tempest tests against
# the three latest interoperability guidelines. It can run in two
# modes.
#
# * If no arguments are specified, the script will check out Tempest
# into a temporary directory, run the consistency checks, then delete
# temporary checkout.
#
# * If an argument is given, this script will assume that it is a
# user checked-out repository and run the consistency checks against
# that, and leave the directory unchanged on exit. This mode is useful
# for gate jobs and Tempest development.
set -x
if [ ! $@ ]; then
TEMPESTDIR=$(mktemp -d)
git clone git://git.openstack.org/openstack/tempest $TEMPESTDIR
CLEANTEMPEST=cleantempest
else
TEMPESTDIR=${1}
fi
PYTHONPATH=$TEMPESTDIR python ./tools/checktests.py --guideline next.json
exit_1=$?
PYTHONPATH=$TEMPESTDIR python ./tools/checktests.py --guideline 2018.02.json
exit_2=$?
PYTHONPATH=$TEMPESTDIR python ./tools/checktests.py --guideline 2017.09.json
exit_3=$?
if [[ ! -z "${CLEANTEMPEST}" ]]; then
rm -rf $TEMPESTDIR
fi
! (( $exit_1 || $exit_2 || $exit_3 ))