-
Notifications
You must be signed in to change notification settings - Fork 31
/
run_tests
executable file
·36 lines (29 loc) · 992 Bytes
/
run_tests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -ex
if [ "$1" == "clean" ]
then
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 update -qq
if [ `python -c 'import sys; print(sys.version_info[0])'` = '3' ]
then
sudo apt-get install -y python3-dev
else
pip install mock
sudo apt-get install -y python-dev
fi
mysql --version | grep -qi maria && sudo apt-get install -y libmariadb-dev-compat libmariadb-dev
mysql --version | grep -qi maria || sudo apt-get install -y libmysqlclient-dev
sudo apt-get install -y build-essential
python -m pip install pytest pytest-cov python-coveralls
python -m pip install -r requirements.txt
python -m pip 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