From 72750165445f4c39e2b830c82daadf1d3fa2786a Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Tue, 9 Dec 2014 10:06:48 -0500 Subject: Add run_cross_tests.sh from incubator Import run_cross_tests.sh from the incubator to make it easier to test the theme and other extensions against existing repositories. Change-Id: Ic36c8950d7cdafcfe74f88ed7dde00f98534b2af --- .gitignore | 1 + openstack-common.conf | 7 ++++ tools/run_cross_tests.sh | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 openstack-common.conf create mode 100755 tools/run_cross_tests.sh diff --git a/.gitignore b/.gitignore index 54989fa..ae9850e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ doc/source/api/tests.*.rst doc/source/api/autoindex.rst doc/source/sourcecode *.mo +.update-venv diff --git a/openstack-common.conf b/openstack-common.conf new file mode 100644 index 0000000..2bae3b4 --- /dev/null +++ b/openstack-common.conf @@ -0,0 +1,7 @@ +[DEFAULT] + +# The list of modules to copy from oslo-incubator.git +script = tools/run_cross_tests.sh + +# The base module to hold the copy of openstack.common +base=oslosphinx diff --git a/tools/run_cross_tests.sh b/tools/run_cross_tests.sh new file mode 100755 index 0000000..5e7bc11 --- /dev/null +++ b/tools/run_cross_tests.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# +# Run cross-project tests +# +# Usage: +# +# run_cross_tests.sh project_dir venv + +# Fail the build if any command fails +set -e + +project_dir="$1" +venv="$2" + +if [ -z "$project_dir" -o -z "$venv" ] +then + cat - < ./subunit_log.txt + fi + .tox/$venv/bin/python /usr/local/jenkins/slave_scripts/subunit2html.py ./subunit_log.txt testr_results.html + gzip -9 ./subunit_log.txt + gzip -9 ./testr_results.html + + export PYTHON=.tox/$venv/bin/python + set -e + rancount=$(.tox/$venv/bin/testr last | sed -ne 's/Ran \([0-9]\+\).*tests in.*/\1/p') + if [ "$rancount" -eq "0" ] ; then + echo + echo "Zero tests were run. At least one test should have been run." + echo "Failing this test as a result" + echo + exit 1 + fi +fi + +# If we make it this far, report status based on the tests that were +# run. +exit $result -- cgit v1.2.1