Changes to sandbox/jenkins-test: get 32-/64-bit barebones MySQL according to OS arch; use /Users/daniel for MySQL binaries; and remove ITERATIONS.

This commit is contained in:
Daniel Nichter
2012-06-29 15:42:03 -06:00
parent 5c914b6e25
commit cf6e4847b4

View File

@@ -1,9 +1,10 @@
#!/bin/sh #!/bin/sh
###################################### # This script is used to do a test run on a Jenkins node. Jenkins jobs
# Source our alt_cmds.sh for _seq(). # # set env vars based on job params (like MYSQL and TEST_CMD) then execute
###################################### # this script which does the rest. When this script exists, the Jenkins
. lib/bash/alt_cmds.sh # job exists, so if some commands (like check-dev-env) fail, then the
# Jenkins job will fail too.
############## ##############
# Set modes. # # Set modes. #
@@ -20,17 +21,43 @@ util/check-dev-env
##################################### #####################################
# Install barebones MySQL binaries. # # Install barebones MySQL binaries. #
##################################### #####################################
if ! [ -d "mysql-${MYSQL}-barebones" ]; then
wget -q http://hackmysql.com/mysql-${MYSQL}-barebones.tar.gz if [ $(uname -a | grep x86_64 >/dev/null 2>&1) ]; then
tar xvfz mysql-${MYSQL}-barebones.tar.gz ARCH="64"
else
ARCH="32"
fi
MYSQL_BIN_DIR="$HOME/mysql-bin"
[ -d "$MYSQL_BIN_DIR" ] || mkdir "$MYSQL_BIN_DIR"
find_mysql_base_dir() {
find "$MYSQL_BIN_DIR" -name "mysql-$1\*" -type -d | tail -n 1
}
MYSQL_BASE_DIR=$(find_mysql_base_dir $MYSQL)
if [ -z "$MYSQL_BASE_DIR" ]; then
(
cd $MYSQL_BIN_DIR
wget -q http://hackmysql.com/barebones/mysql/$MYSQL/$ARCH
tarball=$(ls -t1 | head -n1)
tar xvfz "$tarball"
rm "$tarball"
)
MYSQL_BASE_DIR=$(find_mysql_base_dir $MYSQL)
fi
if [ -z "$MYSQL_BASE_DIR/bin/mysqld -V" ]; then
echo "$MYSQL_BASE_DIR/bin/mysqld does not execute" >&2
exit 1
fi fi
########################## ##########################
# Set required env vars. # # Set required env vars. #
########################## ##########################
export PERCONA_TOOLKIT_BRANCH="$PWD" export PERCONA_TOOLKIT_BRANCH="$PWD"
export PERCONA_TOOLKIT_SANDBOX="$PWD/mysql-${MYSQL}-barebones" export PERCONA_TOOLKIT_SANDBOX="$MYSQL_BASE_DIR"
export PATH="$PATH:/usr/sbin:$PWD/mysql-${MYSQL}-barebones/bin" export PATH="$PATH:/usr/sbin:$MYSQL_BASE_DIR/bin"
############################# #############################
# Check and start test env. # # Check and start test env. #
@@ -55,13 +82,12 @@ fi
# Run the tests. # # Run the tests. #
################## ##################
EXIT_STATUS=0 EXIT_STATUS=0
ITERATIONS="${ITERATIONS:-1}" TEST_CMD="${TEST_CMD:-"prove -r t/"}"
for iter in $(_seq $ITERATIONS); do
( (
$TEST_CMD $TEST_CMD
) )
EXIT_STATUS=$(($? | 0)) EXIT_STATUS=$(($? | 0))
done
############# #############
# Clean up. # # Clean up. #