Commit e74d02f8 authored by Michal Čihař's avatar Michal Čihař

Use travis to test against MySQL and PostgreSQL as well

This will hopefully allow to spot issues like issue #319.
parent f2c9d094
......@@ -5,6 +5,9 @@ python:
env:
- DJANGO_VERSION=1.4.5
- DJANGO_VERSION=1.5.1
- DATABASE=mysql
- DATABASE=postgresql
- DATABASE=sqlite
before_install:
- sudo apt-get update -qq
- sudo apt-get install git libcairo2-dev libgtk2.0-dev libglib2.0-dev libtool libpango1.0-dev libatk1.0-dev libffi-dev
......@@ -40,13 +43,15 @@ install:
- make > /dev/null
- make install > /dev/null
- cd ..
# generate configuration
# generate configuration and create databases
before_script:
- cp weblate/settings_example.py weblate/settings.py
- if [[ $DATABASE = mysql ]] ; then mysql -e 'create database weblate;' ; fi
- if [[ $DATABASE = postgresql ]] ; then psql -c 'create database weblate;' -U postgres ; fi
# commands to run tests
script:
- ./scripts/generate-locales
- ./manage.py validate
- ./manage.py syncdb --noinput
- ./manage.py migrate
- ./manage.py test --settings weblate.settings_test trans lang accounts
- ./manage.py validate --settings weblate.settings_test_$DATABASE
- ./manage.py syncdb --noinput --settings weblate.settings_test_$DATABASE
- ./manage.py migrate --settings weblate.settings_test_$DATABASE
- ./manage.py test --settings weblate.settings_test_$DATABASE trans lang accounts
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# Django settings for running testsuite with MySQL database
#
from weblate.settings_test import *
DATABASES = {
'default': {
# Use 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'ENGINE': 'django.db.backends.mysql',
# Database name or path to database file if using sqlite3.
'NAME': 'weblate',
# Database user, not used with sqlite3.
'USER': 'root',
# Database pasword, not used with sqlite3.
'PASSWORD': '',
# Set to empty string for localhost. Not used with sqlite3.
'HOST': '127.0.0.1',
# Set to empty string for default. Not used with sqlite3.
'PORT': '',
}
}
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# Django settings for running testsuite with PostgreSQL database
#
from weblate.settings_test import *
DATABASES = {
'default': {
# Use 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'ENGINE': 'django.db.backends.postgresql_psycopg2',
# Database name or path to database file if using sqlite3.
'NAME': 'weblate',
# Database user, not used with sqlite3.
'USER': 'postgres',
# Database pasword, not used with sqlite3.
'PASSWORD': '',
# Set to empty string for localhost. Not used with sqlite3.
'HOST': '127.0.0.1',
# Set to empty string for default. Not used with sqlite3.
'PORT': '',
}
}
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# Django settings for running testsuite with SQLite (the default)
#
from weblate.settings_test import *
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment