From ceef935178e5158cd4bb22b0f29ab33578b0a241 Mon Sep 17 00:00:00 2001 From: Jess Hottenstein Date: Tue, 29 Jul 2014 13:37:45 -0400 Subject: [PATCH] [jhottenstein] Changes to get the integration tests running * Added documentation * Added REDSTORM_COMMAND environment variable for run_all.sh * Reverted to non EOL ubuntu version --- test/README.md | 17 ++++++++++++++++- test/integration/run_all.sh | 35 +++++++++++++++++++---------------- vagrant/Vagrantfile | 4 ++-- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/test/README.md b/test/README.md index 690c796..f432b0c 100644 --- a/test/README.md +++ b/test/README.md @@ -1,3 +1,18 @@ # Integration Tests -These are integration tests to automate the testing of topology submission in a local and remote cluster. More documentation on usage to come. \ No newline at end of file +These are integration tests to automate the testing of topology submission in a local and remote cluster. More documentation on usage to come. + +##Prerequisites + * Storm cluster available + * Run the vagrant machine - https://github.com/colinsurprenant/redstorm/blob/master/vagrant/README.md + * Setup a storm cluster - https://storm.incubator.apache.org/documentation/Setting-up-a-Storm-cluster.html + * Redis Server listening on localhost:6379 + * Run the vagrant machine - https://github.com/colinsurprenant/redstorm/blob/master/vagrant/README.md + * Install redis locally - http://redis.io/download + * Storm client installed locally - http://storm.incubator.apache.org/documentation/Setting-up-development-environment.html + * ~/.storm/storm.yaml pointing at your storm cluster - eg. ``nimbus.host: "localhost"`` + +##Running tests + + * ``$ test/integration/run_all.sh`` - Uses locally bundled redstorm + * ``$ REDSTORM_COMMAND=/usr/bin/redstorm test/integration/run_all.sh`` - Set REDSTORM_COMMAND to use a specific redstorm binary \ No newline at end of file diff --git a/test/integration/run_all.sh b/test/integration/run_all.sh index cb4ea5c..bd19ed0 100755 --- a/test/integration/run_all.sh +++ b/test/integration/run_all.sh @@ -1,20 +1,23 @@ #!/bin/bash TOPOLOGIES=test/topology/*.rb -COMMANDS=("redstorm" "bundle exec redstorm" "bin/redstorm" ) -REDSTORM="" +COMMANDS=("bundle exec redstorm" "bin/redstorm" ) -# export PATH="$PATH:./storm/bin" +if test -z "${REDSTORM_COMMAND}" +then + # figure correct command + for c in "${COMMANDS[@]}"; do + $c version &> /dev/null + if [ $? -eq 0 ]; then + REDSTORM_COMMAND=$c + break + fi + done +fi +echo "Using '${REDSTORM_COMMAND}' as the redstorm command" -# figure correct command -for c in "${COMMANDS[@]}"; do - $c version &> /dev/null - if [ $? -eq 0 ]; then - REDSTORM=$c - break - fi -done -if [ "$REDSTORM" == "" ]; then +$REDSTORM_COMMAND version &> /dev/null +if [ $? -ne 0 ]; then echo "redstorm command not found" exit 1 fi @@ -23,12 +26,12 @@ if [[ $@ != "noinstall" ]]; then # install target rm -rf target bundle install - $REDSTORM install - $REDSTORM bundle topology - $REDSTORM jar test + $REDSTORM_COMMAND install + $REDSTORM_COMMAND bundle topology + $REDSTORM_COMMAND jar test fi -echo "runnig integration tests..." +echo "running integration tests..." # run local mode tests for t in $TOPOLOGIES; do diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile index 9e3753d..734b58d 100644 --- a/vagrant/Vagrantfile +++ b/vagrant/Vagrantfile @@ -136,8 +136,8 @@ Vagrant.configure("2") do |config| end config.vm.define :dev do |dev| - dev.vm.box = "quantal64-amd64" - dev.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/quantal/current/quantal-server-cloudimg-amd64-vagrant-disk1.box" + dev.vm.box = "precise-amd64" + dev.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box" # storm ui dev.vm.network :forwarded_port, :guest => 8080, :host => 8080