From 580e5e002fb7a8fd68eb503bba9bf610a35b2565 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 5 Jan 2015 02:29:58 -0400 Subject: [PATCH] Update travis CI file to test agains different databases, add travis DB setting files --- .travis.yml | 12 +++++++++++- mayan/settings/travis/__init__.py | 0 mayan/settings/travis/db_mysql.py | 11 +++++++++++ mayan/settings/travis/db_postgresql.py | 11 +++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 mayan/settings/travis/__init__.py create mode 100644 mayan/settings/travis/db_mysql.py create mode 100644 mayan/settings/travis/db_postgresql.py diff --git a/.travis.yml b/.travis.yml index f973ef1478..c757257ab9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,15 +8,25 @@ python: env: global: - TEST_APPS="document_indexing documents dynamic_search lock_manager document_signatures folders ocr tags" + matrix: + - DB=mysql + - DB=postgres + - DB=sqlite before_install: - sudo apt-get update -qq - sudo apt-get install -qq python-dev gcc tesseract-ocr unpaper ghostscript libjpeg-dev libpng-dev poppler-utils install: - "pip install -r requirements/testing.txt" + - if [[ $DB == mysql ]]; then pip install -q mysql-python; fi + - if [[ $DB == postgres ]]; then pip install -q psycopg2; fi before_script: + - mysql -e 'create database mayan_edms;' + - psql -c 'create database mayan_edms;' -U postgres - "python manage.py initialsetup" script: - - coverage run manage.py test $TEST_APPS + - if [[ $DB == mysql ]]; then coverage run manage.py test $TEST_APPS --settings=mayan.settings.travis.db_mysql; fi + - if [[ $DB == postgres ]]; then coverage run manage.py test $TEST_APPS --settings=mayan.settings.travis.db_postgres; fi + - if [[ $DB == sqlite ]]; then coverage run manage.py test $TEST_APPS; fi after_success: - coveralls branches: diff --git a/mayan/settings/travis/__init__.py b/mayan/settings/travis/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/settings/travis/db_mysql.py b/mayan/settings/travis/db_mysql.py new file mode 100644 index 0000000000..2f73b681db --- /dev/null +++ b/mayan/settings/travis/db_mysql.py @@ -0,0 +1,11 @@ +from __future__ import absolute_import + +from .. import * + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'mayan_edms', + 'USER': 'travis', + } +} diff --git a/mayan/settings/travis/db_postgresql.py b/mayan/settings/travis/db_postgresql.py new file mode 100644 index 0000000000..7a1a70f53c --- /dev/null +++ b/mayan/settings/travis/db_postgresql.py @@ -0,0 +1,11 @@ +from __future__ import absolute_import + +from .. import * + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'mayan_edms', + 'USER': 'postgres', + } +}