create-test-environment
author Hal Wine <hwine@mozilla.com>
Tue, 03 Jun 2014 16:07:26 -0700
changeset 359284 57b51fdb0c8767101be83495c4bad90667623c6c
parent 359046 d05f85fd37aebb063892a3a58bf17aa16278f614
child 359295 6eb84cd52f27e3deee549bcc1fde989cae159c49
permissions -rwxr-xr-x
bug 1010053 - remove try_gcc45 hook; r=glandium

#!/bin/bash

set -e

if [ ! -d venv ]; then
  virtualenv venv
fi

source venv/bin/activate
pip install --upgrade -r test-requirements.txt

# ReviewBoard doesn't work with pip, sadly.
easy_install ReviewBoard==2.0.3

# rbmozui requires Node.js when installed normally. But in local
# development mode it doesn't. So use local development node.
cd pylib/rbmozui;
python setup.py develop
cd ../..

cd pylib/rbbz
python setup.py develop
cd ../..

# Collect code coverage from all Python processes if environment variable
# is set.
cat > venv/bin/sitecustomize.py << EOF
import os

if os.environ.get('CODE_COVERAGE', False):
    import uuid
    import coverage

    covpath = os.path.join(os.environ['COVERAGE_DIR'],
        'coverage.%s' % uuid.uuid1())
    cov = coverage.coverage(data_file=covpath, auto_data=True)
    cov._warn_no_data = False
    cov._warn_unimported_source = False
    cov.start()
EOF

# Install various Mercurial versions for multi-version testing.
if [ ! -d venv/hg ]; then
  hg clone http://selenic.com/repo/hg venv/hg
fi

for v in 2.5.4 2.6 2.6.1 2.6.2 2.6.3 2.7 2.7.1 2.7.2 2.8 2.8.1 2.8.2 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2; do
  destdir=`pwd`/venv/mercurials/$v
  if [ ! -d $destdir ]; then
    cd venv/hg
    hg up $v
    make install PREFIX=$destdir
    make clean
    cd ../..
  fi
done