Permalink
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (29 sloc) 1.29 KB
language: python
python:
- "2.6"
- "2.7"
env:
-
- MIGRATIONS=yes
- SEARCH=elasticsearch
- DB=mysql
- MIGRATIONS=yes DB=mysql
before_install:
- if [ $SEARCH == 'elasticsearch' ]; then sudo service elasticsearch start; sleep 3; fi
install:
- pip install . --no-deps
- pip install --use-mirrors --no-deps -r test_project/requirements.txt
- if [ $TRAVIS_PYTHON_VERSION == '2.6' ]; then pip install --use-mirrors --no-deps importlib ordereddict; fi
- if [ $MIGRATIONS == 'yes' ]; then pip install --use-mirrors --no-deps south; fi
- if [ $SEARCH == 'elasticsearch' ]; then pip install --use-mirrors --no-deps pyelasticsearch==0.2; fi
- if [ $DB == 'mysql' ]; then pip install --use-mirrors --no-deps mysql-python; fi
before_script:
- if [ $DB == 'mysql' ]; then mysql -e 'CREATE DATABASE mirocommunity_test;'; fi
script:
- cd test_project
- MC_DIR=`python -c "import localtv, os; print(os.path.dirname(localtv.__file__))"`
# Run contrib tests first so that contest/video foreign keys
# get set up correctly.
- if [ ! $MIGRATIONS ]; then ./manage.py test --verbosity=2 localtv.contrib localtv.tests --exclude-dir=$MC_DIR/tests/selenium; fi
- if [ $MIGRATIONS == 'yes' ]; then ./manage.py syncdb --noinput; fi
- if [ $MIGRATIONS == 'yes' ]; then ./manage.py migrate --noinput; fi