From d2973a2f0c996791b9c7199eaa651fdbec7d5235 Mon Sep 17 00:00:00 2001 From: kmmbvnr Date: Sun, 30 May 2010 17:33:16 +0700 Subject: [PATCH] Use local environment. Update on demand --- tests/run_tests.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/run_tests.sh b/tests/run_tests.sh index fe1374d6..dc7e2006 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -1,14 +1,22 @@ -#!/bin/bash -e +#!/bin/bash + SCRIPT_DIR=`dirname $0` -DEST_DIR=`mktemp -t -d ci-django-fsm-XXX` +ROOT_DIR=`cd $SCRIPT_DIR/.. && pwd` -cd $SCRIPT_DIR/../ +ENVSPEC=`stat -c %Y $ROOT_DIR/tests/environment.pip` +ENVTIME=`test -d $ROOT_DIR/.ve && stat -c %Y $ROOT_DIR/.ve` -# Setup environment -virtualenv --no-site-packages $DEST_DIR -source $DEST_DIR/bin/activate +set -e -pip install -r tests/environment.pip +if [ $ENVSPEC -gt 0$ENVTIME ]; then + # Setup environment + virtualenv --no-site-packages $ROOT_DIR/.ve + source $ROOT_DIR/.ve/bin/activate + pip install -r $ROOT_DIR/tests/environment.pip + touch $ROOT_DIR/.ve +else + source $ROOT_DIR/.ve/bin/activate +fi # Run tests python <