Skip to content

Commit

Permalink
Use a driver script for the system tests
Browse files Browse the repository at this point in the history
Avoids duplication of job configuration on the server.
Refs #10870
  • Loading branch information
martyngigg committed Feb 13, 2015
1 parent be9daee commit f1ba93a
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Code/Mantid/Build/Jenkins/buildscript
Expand Up @@ -9,6 +9,7 @@
# BUILD_THREADS & PARAVIEW_DIR should be set in the configuration of each
# slave.
###############################################################################
SCRIPT_DIR=$(dirname $(readlink -f "$0"))

###############################################################################
# Print out the versions of things we are using
Expand Down Expand Up @@ -203,10 +204,5 @@ fi
# from a package to have at least one Linux checks it install okay
###############################################################################
if [[ "${ON_RHEL6}" == true ]] && [[ ${JOB_NAME} == *pull_requests* ]]; then
PKGDIR=${WORKSPACE}/build
# Turn off usage reports and instrument downloading for the mantid call
# that creates the properties file
echo "UpdateInstrumentDefinitions.OnStartup = 0" > $userprops
echo "usagereports.enabled = 0" >> $userprops
python $WORKSPACE/Code/Mantid/Testing/SystemTests/scripts/InstallerTesting.py -o -d $PKGDIR
$SCRIPT_DIR/systemtests
fi
71 changes: 71 additions & 0 deletions Code/Mantid/Build/Jenkins/systemtests
@@ -0,0 +1,71 @@
#!/bin/bash -ex
###############################################################################
# LINUX/MAC SCRIPT TO DRIVE THE SYSTEM TESTS OF MANTID
#
# Notes:
#
# WORKSPACE, JOB_NAME, NODE_LABEL GIT_COMMIT are environment variables that
# are set by Jenkins. The last one corresponds to any labels set on a slave.
###############################################################################

###############################################################################
# Print out the versions of things we are using
###############################################################################
cmake --version
echo "SHA1=${sha1}"

###############################################################################
# Set up the location for the local object store outside of the build and
# source tree, which can be shared by multiple builds.
# It defaults to the parent directory of the workspace but can be overridden
# by setting the MANTID_DATA_STORE environment variable.
###############################################################################
if [ -z "$MANTID_DATA_STORE" ]; then
export MANTID_DATA_STORE=$(dirname $WORKSPACE)
fi

###############################################################################
# RHEL6 setup steps - nodes must have a "rhel6" label set (in lowercase)
###############################################################################
if [[ ${NODE_LABELS} == *rhel6* ]]; then
SCL_ON_RHEL6="scl enable mantidlibs"
ON_RHEL6=true
else
SCL_ON_RHEL6="eval"
fi

###############################################################################
# Create the build directory if it doesn't exist
###############################################################################
[ -d $WORKSPACE/build ] || mkdir $WORKSPACE/build
cd $WORKSPACE/build

###############################################################################
# CMake configuration if it has not already been configured
# We use the special flag that only creates the targets for the data
###############################################################################
if [[ ! -e $WORKSPACE/build/CMakeCache.txt ]]; then
$SCL_ON_RHEL6 "cmake -DMANTID_DATA_STORE=${MANTID_DATA_STORE} -DTESTING_DATA_ONLY=ON ../Code/Mantid"
fi

###############################################################################
# Build step
###############################################################################
$SCL_ON_RHEL6 "cmake --build . -- StandardTestData"
$SCL_ON_RHEL6 "cmake --build . -- SystemTestData"

###############################################################################
# Run the tests
###############################################################################
# Remove any Mantid.user.properties file
userprops=~/.mantid/Mantid.user.properties
rm -f $userprops
# Turn off usage reports and instrument downloading for the mantid call
# that creates the properties file
echo "UpdateInstrumentDefinitions.OnStartup = 0" > $userprops
echo "usagereports.enabled = 0" >> $userprops

# Run
PKGDIR=${WORKSPACE}/build
python $WORKSPACE/Code/Mantid/Testing/SystemTests/scripts/InstallerTests.py -o -d $PKGDIR

0 comments on commit f1ba93a

Please sign in to comment.