Skip to content
Browse files

Make sure contrib.nonrel tests are always run on mongodb.

Also removed the $TEST env part from ci testing
because runtests.py already knows which tests it
should run.
  • Loading branch information...
1 parent d99c28d commit 5cef8fe8b8807903e3c4a69d76468ffeb7636efe @charettes committed Aug 8, 2012
Showing with 29 additions and 28 deletions.
  1. +20 −19 .travis.yml
  2. +9 −9 runtests.py
View
39 .travis.yml
@@ -9,23 +9,23 @@ python:
- 2.7
env:
- - REQUIREMENTS=1.3.X TESTS="mutant boolean temporal file numeric related text web south polymodels" ENGINE=sqlite3
- - REQUIREMENTS=1.3.X-postgres TESTS="mutant boolean temporal file numeric related text web south polymodels" ENGINE=postgresql TEMPLATE=template0
- - REQUIREMENTS=1.3.X-postgres TESTS="mutant boolean temporal file numeric related text web south geo polymodels" ENGINE=postgis TEMPLATE=template_postgis
- - REQUIREMENTS=mongo TESTS="mutant boolean temporal file numeric nonrel text web polymodels" ENGINE=mongodb
- - REQUIREMENTS=1.4.X TESTS="mutant boolean temporal file numeric related text web south polymodels" ENGINE=sqlite3
- - REQUIREMENTS=1.4.X-postgres TESTS="mutant boolean temporal file numeric related text web south polymodels" ENGINE=postgresql TEMPLATE=template0
- - REQUIREMENTS=1.4.X-postgres TESTS="mutant boolean temporal file numeric related text web south geo polymodels" ENGINE=postgis TEMPLATE=template_postgis
- - REQUIREMENTS=master TESTS="mutant boolean temporal file numeric related text web south polymodels" ENGINE=sqlite3
- - REQUIREMENTS=master-postgres TESTS="mutant boolean temporal file numeric related text web south polymodels" ENGINE=postgresql TEMPLATE=template0
- - REQUIREMENTS=master-postgres TESTS="mutant boolean temporal file numeric related text web south geo polymodels" ENGINE=postgis TEMPLATE=template_postgis
+ - REQUIREMENTS=1.3.X ENGINE=sqlite3
+ - REQUIREMENTS=1.3.X-postgres ENGINE=postgresql TEMPLATE=template0
+ - REQUIREMENTS=1.3.X-postgres ENGINE=postgis TEMPLATE=template_postgis
+ - REQUIREMENTS=mongo ENGINE=mongodb
+ - REQUIREMENTS=1.4.X ENGINE=sqlite3
+ - REQUIREMENTS=1.4.X-postgres ENGINE=postgresql TEMPLATE=template0
+ - REQUIREMENTS=1.4.X-postgres ENGINE=postgis TEMPLATE=template_postgis
+ - REQUIREMENTS=master ENGINE=sqlite3
+ - REQUIREMENTS=master-postgres ENGINE=postgresql TEMPLATE=template0
+ - REQUIREMENTS=master-postgres ENGINE=postgis TEMPLATE=template_postgis
matrix:
allow_failures:
- - env: REQUIREMENTS=mongo TESTS="mutant boolean temporal file numeric nonrel text web polymodels" ENGINE=mongodb
- - env: REQUIREMENTS=master TESTS="mutant boolean temporal file numeric related text web south polymodels" ENGINE=sqlite3
- - env: REQUIREMENTS=master-postgres TESTS="mutant boolean temporal file numeric related text web south polymodels" ENGINE=postgresql TEMPLATE=template0
- - env: REQUIREMENTS=master-postgres TESTS="mutant boolean temporal file numeric related text web south geo polymodels" ENGINE=postgis TEMPLATE=template_postgis
+ - env: REQUIREMENTS=mongo ENGINE=mongodb
+ - env: REQUIREMENTS=master ENGINE=sqlite3
+ - env: REQUIREMENTS=master-postgres ENGINE=postgresql TEMPLATE=template0
+ - env: REQUIREMENTS=master-postgres ENGINE=postgis TEMPLATE=template_postgis
postgres:
adapter: postgresql
@@ -38,10 +38,11 @@ install:
- python setup.py install
before_script:
- - "if [ -d '/usr/share/postgresql/8.4/' ]; then PG='8.4'; else PG='9.1'; fi"
- - "if echo $ENGINE | grep 'postgis'; then sudo apt-get install binutils gdal-bin libproj-dev postgresql-${PG}-postgis; fi"
- - "if echo $ENGINE | grep 'postgis'; then sudo su postgres -c './create_template_postgis-debian.sh'; fi"
- - "if echo $ENGINE | grep -E '(postgresql|postgis)'; then psql -c \"CREATE DATABASE mutant TEMPLATE ${TEMPLATE};\" -U postgres; fi"
+ - if [ -d '/usr/share/postgresql/8.4/' ]; then PG='8.4'; else PG='9.1'; fi
+ - if echo $ENGINE | grep 'postgis'; then sudo apt-get install binutils gdal-bin libproj-dev postgresql-${PG}-postgis; fi
+ - if echo $ENGINE | grep 'postgis'; then sudo su postgres -c './create_template_postgis-debian.sh'; fi
+ - if echo $ENGINE | grep -E '(postgresql|postgis)'; then psql -c "CREATE DATABASE mutant TEMPLATE ${TEMPLATE};" -U postgres; fi
script:
- - python runtests.py $TESTS --engine=$ENGINE
+ - python runtests.py --engine=$ENGINE
+
View
18 runtests.py
@@ -81,22 +81,19 @@ def allow_syncdb(self, db, model):
'NAME': ':memory:',
},
'mongo': {
- 'ENGINE' : 'django_mongodb_engine',
- 'NAME' : 'mutant',
+ 'ENGINE': 'django_mongodb_engine',
+ 'NAME': 'mutant',
'OPTIONS': {
'OPERATIONS': {
- 'save' : {'safe' : True},
+ 'save': {'safe': True},
}
}
}
},
- 'DATABASE_ROUTERS': (
- 'runtests.MongoRouter',
- ),
+ 'DATABASE_ROUTERS': ('runtests.MongoRouter',),
'SOUTH_DATABASE_ADAPTERS': {
'mongo': 'django_mongodb_engine.south_adapter'
},
- # FK and M2M are not supported for nonrel db
'INSTALLED_APPS': DEFAULT_SETTINGS['INSTALLED_APPS'][0:-1] + [
'django_mongodb_engine',
'djangotoolbox',
@@ -131,13 +128,15 @@ def main(engine, user, verbosity, failfast, test_labels):
test_labels.append('geo')
elif engine == 'mongodb':
test_labels.remove('related')
+ test_labels.append('nonrel')
options = dict(DEFAULT_SETTINGS, **engine_settings)
if user:
options['DATABASES']['default']['USER'] = user
settings.configure(**options)
from django.test.utils import get_runner
TestRunner = get_runner(settings)
- test_runner = TestRunner(verbosity=verbosity, interactive=False, failfast=failfast)
+ test_runner = TestRunner(verbosity=verbosity, interactive=False,
+ failfast=failfast)
failures = test_runner.run_tests(test_labels)
sys.exit(failures)
@@ -150,4 +149,5 @@ def main(engine, user, verbosity, failfast, test_labels):
parser.add_argument('--verbosity', default=1)
parser.add_argument('test_labels', nargs='*')
args = parser.parse_args()
- main(args.engine, args.user, args.verbosity, args.failfast, args.test_labels)
+ main(args.engine, args.user, args.verbosity,
+ args.failfast, args.test_labels)

0 comments on commit 5cef8fe

Please sign in to comment.
Something went wrong with that request. Please try again.