Skip to content

Commit

Permalink
Add clean option to the run test script.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkiro committed Jan 15, 2016
1 parent 56e4c0f commit 35fb62f
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions scripts/run_tests
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
#!/bin/bash
set -ev
set -ex

sudo apt-get update -qq

if [ `python -c 'import sys; print(sys.version_info[0])'` = '3' ]
if [ "$1" == "clean" ]
then
sudo apt-get install -y python3-dev
2to3 -w . ./scripts/pyzor ./scripts/pyzord ./scripts/pyzor-migrate
rm -rf build .cache dist .coverage pyzor.egg-info
mysql -e 'drop database if exists pyzor_test'
git reset --hard HEAD
else
sudo apt-get install -y python-dev
fi

mysql --version | grep -qi maria && sudo apt-get install -y libmariadbclient-dev
mysql --version | grep -qi maria || sudo apt-get install -y libmysqlclient-dev
sudo apt-get update -qq

sudo apt-get install -y build-essential
if [ `python -c 'import sys; print(sys.version_info[0])'` = '3' ]
then
sudo apt-get install -y python3-dev
2to3 -w . ./scripts/pyzor ./scripts/pyzord ./scripts/pyzor-migrate
else
sudo apt-get install -y python-dev
fi

pip install pytest pytest-cov python-coveralls
pip install -r requirements.txt
python setup.py install
mysql -e 'create database if not exists pyzor_test'
mysql --version | grep -qi maria && sudo apt-get install -y libmariadbclient-dev
mysql --version | grep -qi maria || sudo apt-get install -y libmysqlclient-dev

sudo apt-get install -y build-essential

if [ "$1" != "prepare" ]
then
py.test tests/unit/ --cov pyzor --cov-report term-missing
py.test tests/functional/
fi
pip install pytest pytest-cov python-coveralls
pip install -r requirements.txt
python setup.py install
mysql -e 'create database if not exists pyzor_test'


if [ "$1" != "prepare" ]
then
py.test tests/unit/ --cov pyzor --cov-report term-missing
py.test tests/functional/
fi
fi

0 comments on commit 35fb62f

Please sign in to comment.