From 4019716055dd815e6196bdcd0b957de4cde4cdaa Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Thu, 25 Oct 2012 16:30:32 -0400 Subject: [PATCH] Bug 805297 - Marionette doesn't recognize relative test path from current working directory. r=jgriffin --- .../marionette/client/marionette/venv_test.sh | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/testing/marionette/client/marionette/venv_test.sh b/testing/marionette/client/marionette/venv_test.sh index ac0a0b675ad..40bb63c8b03 100755 --- a/testing/marionette/client/marionette/venv_test.sh +++ b/testing/marionette/client/marionette/venv_test.sh @@ -5,16 +5,18 @@ PYTHON=$1 +# Store the current working directory so we can change back into it after +# preparing the Marionette virtualenv +CWD=$(pwd) + if [ -z "${PYTHON}" ] then echo "No python found" exit 1 fi -# Determine the absolute path of our location. -MARIONETTE_HOME=`dirname $0` -cd $MARIONETTE_HOME -MARIONETTE_HOME=`dirname $PWD` +# Determine the absolute path of the Marionette home folder +MARIONETTE_HOME=$(cd `dirname $BASH_SOURCE`; dirname `pwd`) echo "Detected Marionette home in $MARIONETTE_HOME" # If a GECKO_OBJDIR environemnt variable exists, we will create the Python @@ -31,24 +33,24 @@ fi if [ -d $VENV_DIR ] then echo "Using virtual environment in $VENV_DIR" - cd $VENV_DIR - . bin/activate + . $VENV_DIR/bin/activate else echo "Creating a virtual environment in $VENV_DIR" curl https://raw.github.com/pypa/virtualenv/develop/virtualenv.py | ${PYTHON} - $VENV_DIR - cd $VENV_DIR - . bin/activate + . $VENV_DIR/bin/activate + # set up mozbase - git clone git://github.com/mozilla/mozbase.git - cd mozbase - python setup_development.py + git clone git://github.com/mozilla/mozbase.git $VENV_DIR/mozbase + python $VENV_DIR/mozbase/setup_development.py fi -# update the marionette_client +# Updating the marionette_client needs us to change into its package folder. +# Otherwise the call to setup.py will hang cd $MARIONETTE_HOME python setup.py develop -cd marionette +cd $CWD # pop off the python parameter shift -python runtests.py $@ + +python $MARIONETTE_HOME/marionette/runtests.py $@