Permalink
Browse files

Script and ant system to run test suites from commandline and generat…

…e reports. Just run: ./scripts/integration-suites.sh <non-existent-directory>
  • Loading branch information...
1 parent bfb615b commit a5af8ca9e696455deb317273defebbb651b31b85 @timf timf committed Jun 5, 2011
@@ -0,0 +1,119 @@
+#!/bin/bash
+
+
+ALL_TEST_SUITES="basic01 basic02 basic03 basic04 basic05 basic06 failure01 spot01 spot02 spot03 spot04 spot05"
+
+
+if [ "X" == "X$1" ]; then
+ echo "Must supply argument: test report directory absolute path"
+ exit 1
+fi
+
+REPORTS_DIR=$1
+
+if [ -e $REPORTS_DIR ]; then
+ echo "Directory exists, use a different argument: $REPORTS_DIR"
+ exit 1
+else
+ echo "Creating reports directory: $REPORTS_DIR"
+ mkdir $REPORTS_DIR
+ if [ $? -ne 0 ]; then
+ echo "Failed to create reports directory: $REPORTS_DIR"
+ exit 1
+ fi
+fi
+
+THISDIR_REL="`dirname $0`"
+THISDIR=`cd $THISDIR_REL; pwd`
+ANTFILE="$THISDIR/../service/service/java/tests/suites/build.xml"
+
+BANNER="Nimbus -"
+NIMBUS_PRINTNAME="Internal Service Integration Test Suites"
+
+echo ""
+echo " *** $BANNER $NIMBUS_PRINTNAME:"
+
+ant -Dnimbussuites.test.reports.dir=$REPORTS_DIR -f $ANTFILE clean depclean
+RET=$?
+if [ $RET -ne 0 ]; then
+ echo "PROBLEM: could not clean? exit code $RET - $BANNER $NIMBUS_PRINTNAME"
+ exit $RET
+fi
+
+count=0
+error_count=0
+possible_count=0
+FAILED_SUITES=""
+TIMINGS="Timings:\n"
+total_time=0
+
+for test_suite in $ALL_TEST_SUITES; do
+ possible_count=`expr $possible_count + 1`
+done
+for test_suite in $ALL_TEST_SUITES; do
+
+ echo ""
+ echo ""
+ echo ""
+ echo "****************************************************************************"
+ echo "********************* NIMBUS TEST SUITE ******************************"
+ echo "****************************************************************************"
+ echo ""
+ echo ""
+
+ ms_before=`echo $(($(date +%s%N)/1000000))`
+
+ ant -Dnimbussuites.test.reports.dir=$REPORTS_DIR -f $ANTFILE $test_suite
+ RET=$?
+
+ if [ $RET -eq 0 ]; then
+ echo "Test Suite Passed: $test_suite"
+ count=`expr $count + 1`
+ else
+ echo "Test Suite Failed: $test_suite"
+ error_count=`expr $error_count + 1`
+ FAILED_SUITES="$test_suite $FAILED_SUITES"
+ fi
+
+ ms_after="$(($(date +%s%N)/1000000))"
+ ms_this=`expr $ms_after - $ms_before`
+ TIMINGS="$TIMINGS - $test_suite: $ms_this ms\n"
+ total_time=`expr $total_time + $ms_this`
+done
+
+
+# Don't print this every time, mainly because it only uses the key names, not
+# the real suite names.
+#echo -e $TIMINGS
+
+
+# Print result and exit with error if any suite failed.
+
+echo -e "\n\n** $BANNER $NIMBUS_PRINTNAME:\n"
+echo " - Took $total_time milliseconds."
+
+if [ $possible_count -eq 1 ]; then
+ echo " - 1 possible test suite."
+else
+ echo " - $possible_count possible test suites."
+fi
+
+if [ $count -eq 1 ]; then
+ echo " - 1 test suite succeeded."
+else
+ echo " - $count test suites succeeded."
+fi
+
+if [ $error_count -eq 0 ]; then
+ echo " - 0 test suites failed."
+elif [ $error_count -eq 1 ]; then
+ echo " - 1 test suite failed: $FAILED_SUITES"
+else
+ echo " - $error_count test suites failed: $FAILED_SUITES"
+fi
+echo ""
+
+if [ $error_count -eq 0 ]; then
+ exit 1
+fi
+exit 0
@@ -0,0 +1,42 @@
+# GENERAL
+nimbus.st.basedir=../../../../..
+nimbus.st.service.api.builddir=${nimbus.st.basedir}/service-api/java/source
+nimbus.st.service.main.builddir=${nimbus.st.basedir}/service/service/java/source
+nimbus.st.metadata.builddir=${nimbus.st.basedir}/metadata/java/source
+nimbus.st.authzdb.builddir=${nimbus.st.basedir}/authzdb
+nimbus.st.main.lib.dir=${nimbus.st.basedir}/lib/services
+nimbus.st.test.lib.dir=${nimbus.st.basedir}/lib/test
+nimbus.st.service.api.dist.dir=${nimbus.st.basedir}/service-api/java/source/dist
+nimbus.st.service.main.dist.dir=${nimbus.st.basedir}/service/service/java/source/dist
+nimbus.st.metadata.dist.dir=${nimbus.st.basedir}/metadata/java/source/dist
+nimbus.st.authz.dist.dir=${nimbus.st.basedir}/authzdb/dist
+nimbus.suitesdir=${basedir}
+
+# BUILD
+nimbus.java.compilerarg=-nowarn
+nimbus.suites.testsrc.build.dest=build/classes
+nimbus.suites.testsrc.src0.dir=common/src
+nimbus.suites.testsrc.src1.dir=basic/src
+nimbus.suites.testsrc.src2.dir=failure/src
+nimbus.suites.testsrc.src3.dir=spotinstances/src
+
+# BASIC SUITES
+st.basic.dir=${nimbus.suitesdir}/basic
+st.basic01=BasicSuite
+st.basic02=DirtiesContextExampleSuite
+st.basic03=IdemptotentCreationSuite
+st.basic04=Issue37Suite
+st.basic05=NodeManagementSuite
+st.basic06=ParallelIdempotentCreationSuite
+
+# FAILURE SUITES
+st.failure.dir=${nimbus.suitesdir}/failure
+st.failure01=TerminateSuite
+
+# SPOT INSTANCE SUITES
+st.spot.dir=${nimbus.suitesdir}/spotinstances
+st.spot01=Issue26Suite
+st.spot02=NoResourcesSISuite
+st.spot03=SimpleSISuite
+st.spot04=SimplestSISuite
+st.spot05=SingleResourcePoolSISuite
Oops, something went wrong.

0 comments on commit a5af8ca

Please sign in to comment.