Parent: [7ba5da] (diff)

Child: [504029] (diff)

Download this file

run_tests    51 lines (43 with data), 1.0 kB

#!/bin/bash

function check_port() {
    PORT=$1
    echo 'quit' |telnet localhost $PORT >/dev/null 2>&1
}

if [ -z "$VIRTUAL_ENV" ]; then
    source /var/local/env-allura/bin/activate
fi

# If this is sandbox and local SOLR isn't running, start it
if [ -n "$SF_SYSTEM_FUNC" ]; then
    if ! check_port 50065; then
        SOLRCONFIG="/var/local/allura/solr_config"
        SOLRLOG=/usr/local/solr/logs/console.log
        echo "Starting SOLR, log is at $SOLRLOG"
        pushd /usr/local/solr
        /usr/java/jdk1.5.0_15/bin/java -Dsolr.solr.home="$SOLRCONFIG" -jar start.jar >$SOLRLOG 2>&1 &
        popd
        sleep 15
    fi
fi

# main

if [ "$TEST_MODULES"  == "" ]; then
    TEST_MODULES="\
    Allura \
    ForgeBlog \
    ForgeLink \
    ForgeDiscussion \
    ForgeGit \
    ForgeHg \
    ForgeMail \
    ForgeSVN \
    ForgeTracker \
    ForgeWiki \
    ForgeDownloads \
    ."
fi

for module in $TEST_MODULES; do
    (
        echo "Running tests in module $module"
        cd $module
        nosetests $* || exit
    ) || exit
done