Check-in [318d5dfec1]
Overview
Comment:Updated nightly test suite to work in clean space
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:318d5dfec18f5d616903dbd368e51ecebbc7b4f0
User & Date: rkeene on 2011-05-21 13:46:38
Other Links: manifest | tags
Context
2011-05-21
13:49
Added basic sanity check to nightly testing script check-in: c2be59edab user: rkeene tags: trunk
13:46
Updated nightly test suite to work in clean space check-in: 318d5dfec1 user: rkeene tags: trunk
04:39
Minor work to make web interface more interactive check-in: f8f78a49b0 user: rkeene tags: trunk
Changes

Modified build/test/do-nightly-tests-and-publish from [75aae2a48d] to [cae4b1c112].

     1      1   #! /bin/bash
     2      2   
     3      3   # Update PATH to include path to Tclkit, otherwise cross-compiles will fail
     4      4   PATH="${PATH}:/home/rkeene/bin:/usr/local/bin"
     5      5   export PATH
     6      6   
     7      7   # Define build and web paths
     8         -KITCREATORDIR="/home/rkeene/devel/kitcreator"
            8  +KITCREATORFOSSIL="/web/customers/kitcreator.rkeene.org/repo/kitcreator.repo"
     9      9   WEBROOTDIR="/web/rkeene/devel/kitcreator/kitbuild"
    10         -export KITCREATORDIR WEBROOTDIR
           10  +MARKERFILE="/web/customers/kitcreator.rkeene.org/repo/__AUTO_TESTS_RUNNING__"
           11  +TMPWORKDIR="${TMPDIR:-/var/tmp}/kitcreator-test-$$${RANDOM}${RANDOM}${RANDOM}"
           12  +export KITCREATORFOSSIL WEBROOTDIR MARKERFILE TMPWORKDIR
    11     13   
    12         -cd "${KITCREATORDIR}" || exit 1
    13         -
    14         -FOSSIL_CHANGE="$(fossil timeline -n 1 -t ci | grep '^[0-9:]* \[' | sed 's@^[0-9:]* \[\([0-9a-f]*\)\].*$@\1@')"
           14  +# Determine change of fossil revision
           15  +FOSSIL_CHANGE="$(fossil timeline --repository "${KITCREATORFOSSIL}" -n 1 -t ci | grep '^[0-9:]* \[' | sed 's@^[0-9:]* \[\([0-9a-f]*\)\].*$@\1@')"
    15     16   TESTNAME="fossil_${FOSSIL_CHANGE}"
    16     17   export FOSSIL_CHANGE TESTNAME
    17     18   
    18     19   # On Wednesday, do a distclean to force redownloading everything (mainly
    19     20   # for CVS Head) and force a rebuild to ensure up-to-date build status
    20         -if [ "$(date '+%u')" = "3" ]; then
    21         -	./kitcreator distclean || exit 1
    22         -else
           21  +if [ "$(date '+%u')" != "3" ]; then
    23     22   	if [ -d "${WEBROOTDIR}/${TESTNAME}" ]; then
    24     23   		# Don't re-run the tests if nothing has changed
    25     24   		exit 0
    26     25   	fi
    27     26   fi
    28     27   
    29         -cd build/test || exit 1
    30         -
    31         -if [ ! -x test -o ! -x publish-tests ]; then
    32         -	echo 'Missing scripts, aborting.' >&2
    33         -
           28  +# Only run one at a time
           29  +if [ -f "${MARKERFILE}" ]; then
    34     30   	exit 1
    35     31   fi
           32  +touch "${MARKERFILE}"
    36     33   
    37         -# Only run one at a time
    38         -if [ -f '__AUTO_TESTS_RUNNING__' ]; then
           34  +# Change to temporary directory to build
           35  +mkdir -p "${TMPWORKDIR}"
           36  +chmod 700 "${TMPWORKDIR}"
           37  +
           38  +cd "${TMPWORKDIR}" || exit 1
           39  +
           40  +# Define clean-up handler
           41  +function die () {
           42  +	echo "$1" >&2
           43  +
           44  +	cd /
           45  +
           46  +	rm -rf "${TMPWORKDIR}"
           47  +
    39     48   	exit 1
           49  +}
           50  +
           51  +# Download latest tarball
           52  +wget -O 'kitcreator-trunk-tip.tar.gz' -o /dev/null 'http://kitcreator.rkeene.org/fossil/tarball/kitcreator-trunk-tip.tar.gz?uuid=trunk'
           53  +
           54  +tar -xf kitcreator-trunk-tip.tar.gz || die 'Tarball Extraction Failed'
           55  +
           56  +cd kitcreator-trunk-tip || die 'Tarball Sanity Failed'
           57  +
           58  +# Prepare source
           59  +./build/pre.sh >/dev/null 2>/dev/null
           60  +
           61  +# Start the tests
           62  +cd build/test || die 'Missing test suite'
           63  +
           64  +if [ ! -x test -o ! -x publish-tests ]; then
           65  +	die 'Missing scripts, aborting.'
    40     66   fi
    41         -touch '__AUTO_TESTS_RUNNING__'
    42     67   
    43     68   # Clean builds
    44     69   rm -rf kits
    45     70   
    46     71   # Run tests
    47     72   nice -n 20 ./test >/dev/null 2>/dev/null
    48     73   
................................................................................
    53     78   ./publish-tests "${TESTNAME}"
    54     79   
    55     80   # Create nightly symlink
    56     81   rm -f "${WEBROOTDIR}/nightly"
    57     82   ln -s "${TESTNAME}" "${WEBROOTDIR}/nightly"
    58     83   
    59     84   # Clean
    60         -rm -f '__AUTO_TESTS_RUNNING__'
           85  +rm -f "${MARKERFILE}"
           86  +cd /
           87  +rm -rf "${TMPWORKDIR}"
    61     88   
    62     89   exit 0