forked from modoboa/modoboa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
49 lines (42 loc) · 1.34 KB
/
.travis.yml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
sudo: false
language: python
cache: pip
python:
- "2.7"
- "3.4"
addons:
apt:
packages:
- ldap-utils
- postfix
- slapd
env:
- DB="POSTGRESQL"
- DB="MYSQL"
services:
- mysql
- postgres
before_install:
- pip install codecov
- if [[ $DB = 'POSTGRESQL' ]]; then pip install -q psycopg2; fi
- if [[ $DB = 'MYSQL' ]]; then pip install -q mysqlclient; fi
install:
- pip install -q -r requirements.txt
- pip install -q -r ldap-requirements.txt
- pip install -q -r test-requirements.txt
- pip install -e .
before_script:
- if [[ $DB = 'POSTGRESQL' ]]; then psql -c 'create database modoboa_test;' -U postgres; fi
- if [[ $DB = 'MYSQL' ]]; then mysql -e "create database IF NOT EXISTS modoboa_test;" -uroot; fi
- if [[ $DB = 'MYSQL' ]]; then mysql -e "CREATE USER 'modoboa'@'localhost' IDENTIFIED BY 'modoboa'" -uroot; fi
- if [[ $DB = 'MYSQL' ]]; then mysql -e "GRANT ALL PRIVILEGES ON * . * TO 'modoboa'@'localhost';" -uroot; fi
- mkdir /tmp/slapd
- slapd -f test_data/slapd.conf -h ldap://localhost:3389 &
- sleep 3
- ldapadd -h localhost:3389 -D cn=admin,dc=example,dc=com -w test -f test_data/base.ldif
script:
- python ./tests.py
- cd test_project
- coverage run --source ../modoboa manage.py test modoboa.core modoboa.lib modoboa.admin modoboa.limits modoboa.relaydomains
after_success:
- codecov