File: run_tests

package info (click to toggle)
pyzor 1%3A1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 868 kB
  • sloc: python: 7,266; makefile: 153; sh: 28
file content (36 lines) | stat: -rwxr-xr-x 992 bytes parent folder | download
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