Add jenkins-test script for simplier build step.

This commit is contained in:
Daniel Nichter
2012-02-14 12:36:00 -07:00
parent 9cfb71dff4
commit 072f69022c

62
sandbox/jenkins-test Normal file
View File

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