From 072f69022ca3d9d3741a0806a9f8067025f9d73c Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Tue, 14 Feb 2012 12:36:00 -0700 Subject: [PATCH] Add jenkins-test script for simplier build step. --- sandbox/jenkins-test | 62 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sandbox/jenkins-test diff --git a/sandbox/jenkins-test b/sandbox/jenkins-test new file mode 100644 index 00000000..9a985a93 --- /dev/null +++ b/sandbox/jenkins-test @@ -0,0 +1,62 @@ +#!/bin/sh + +###################################### +# Source our alt_cmds.sh for _seq(). # +###################################### +. lib/bash/alt_cmds.sh + +############## +# Set modes. # +############## +set +u +set -e + +################################## +# Check for needed Perl modules. # +################################## +util/check-dev-env + +##################################### +# Install barebones MySQL binaries. # +##################################### +if ! [ -d "mysql-${MYSQL}-barebones" ]; then + wget -q http://hackmysql.com/mysql-${MYSQL}-barebones.tar.gz + tar xvfz mysql-${MYSQL}-barebones.tar.gz +fi + +########################## +# Set required env vars. # +########################## +export PERCONA_TOOLKIT_BRANCH="$PWD" +export PERCONA_TOOLKIT_SANDBOX="$PWD/mysql-${MYSQL}-barebones" +export PATH="$PATH:/usr/sbin:$PWD/mysql-${MYSQL}-barebones/bin" + +############################# +# Check and start test env. # +############################# +sandbox/test-env checkconfig +sandbox/test-env restart + +####################### +# Set debug env vars. # +####################### +if [ "$DEBUG_CODE" = "true" ]; then + export PTDEBUG=1 +fi + +if [ "$DEBUG_TEST" = "true" ]; then + export PTDEVDEBUG=1 +fi + +################## +# Run the tests. # +################## +ITERATIONS={ITERATIONS:-1} +for iter in $(_seq $ITERATIONS); do + $TEST_CMD +done + +############# +# Clean up. # +############# +sandbox/test-env stop