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