Merge pull request #66 from nephila/test_runs
Refactor travis configuration
This commit is contained in:
commit
42c6af5ddf
8 changed files with 42 additions and 22 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -45,3 +45,5 @@ lokalize*
|
||||||
docs
|
docs
|
||||||
|
|
||||||
*~
|
*~
|
||||||
|
*.db
|
||||||
|
*.sqlite
|
29
.travis.yml
29
.travis.yml
|
@ -10,35 +10,38 @@ python:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
- DJANGO='django>=1.5,<1.6' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
- DJANGO='django15' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
||||||
- DJANGO='django>=1.6,<1.7' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
- DJANGO='django16' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
||||||
- DJANGO='django>=1.7,<1.8' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
- DJANGO='django17' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
||||||
|
|
||||||
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
|
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
|
||||||
install:
|
install:
|
||||||
- pip install $DJANGO
|
- pip install -U tox>=1.8 coveralls
|
||||||
- pip install -r requirements-test.txt
|
- "if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then export PYVER=py26; fi"
|
||||||
|
- "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then export PYVER=py27; fi"
|
||||||
|
- "if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then export PYVER=py33; fi"
|
||||||
|
- "if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then export PYVER=py34; fi"
|
||||||
|
|
||||||
# command to run tests, e.g. python setup.py test
|
# command to run tests, e.g. python setup.py test
|
||||||
script: djangocms-helper djangocms_blog test --cms --nose-runner
|
script: COMMAND='coverage run' tox -e"$PYVER-$DJANGO"
|
||||||
|
|
||||||
after_success: coveralls
|
after_success: coveralls
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
exclude:
|
exclude:
|
||||||
- python: 2.6
|
- python: 2.6
|
||||||
env: DJANGO='django>=1.7,<1.8' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
env: DJANGO='django17' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
||||||
|
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- python: 3.3
|
- python: 3.3
|
||||||
env: DJANGO='django>=1.5,<1.6' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
env: DJANGO='django15' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
||||||
- python: 3.3
|
- python: 3.3
|
||||||
env: DJANGO='django>=1.6,<1.7' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
env: DJANGO='django16' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
||||||
- python: 3.3
|
- python: 3.3
|
||||||
end: DJANGO='django>=1.7,<1.8' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
end: DJANGO='django17' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
||||||
- python: 3.4
|
- python: 3.4
|
||||||
env: DJANGO='django>=1.5,<1.6' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
env: DJANGO='django15' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
||||||
- python: 3.4
|
- python: 3.4
|
||||||
env: DJANGO='django>=1.6,<1.7' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
env: DJANGO='django16' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
||||||
- python: 3.4
|
- python: 3.4
|
||||||
env: DJANGO='django>=1.7,<1.8' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
env: DJANGO='django17' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1
|
||||||
|
|
11
cms_helper.py
Normal file → Executable file
11
cms_helper.py
Normal file → Executable file
|
@ -1,4 +1,6 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from tempfile import mkdtemp
|
from tempfile import mkdtemp
|
||||||
gettext = lambda s: s
|
gettext = lambda s: s
|
||||||
|
@ -94,3 +96,12 @@ HELPER_SETTINGS = {
|
||||||
}
|
}
|
||||||
if 'test' in sys.argv:
|
if 'test' in sys.argv:
|
||||||
HELPER_SETTINGS['INSTALLED_APPS'].append('django_nose')
|
HELPER_SETTINGS['INSTALLED_APPS'].append('django_nose')
|
||||||
|
|
||||||
|
|
||||||
|
def run():
|
||||||
|
from djangocms_helper import runner
|
||||||
|
sys.argv.append('--nose-runner')
|
||||||
|
runner.cms('djangocms_blog')
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
run()
|
|
@ -5,5 +5,5 @@ mock>=1.0.1
|
||||||
nose>=1.3.0
|
nose>=1.3.0
|
||||||
django-nose>=1.2
|
django-nose>=1.2
|
||||||
flake8
|
flake8
|
||||||
https://github.com/nephila/djangocms-helper/archive/django_17.zip
|
https://github.com/nephila/djangocms-helper/archive/develop.zip
|
||||||
tox>=1.8
|
tox>=1.8
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -1,5 +1,5 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
@ -50,11 +50,12 @@ setup(
|
||||||
'cmsplugin-filer',
|
'cmsplugin-filer',
|
||||||
'django-meta>=0.2',
|
'django-meta>=0.2',
|
||||||
'django-meta-mixin>=0.1.1',
|
'django-meta-mixin>=0.1.1',
|
||||||
'south>=1.0.1',
|
'south>=1.0.1',
|
||||||
],
|
],
|
||||||
license="BSD",
|
license="BSD",
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
keywords='djangocms-blog, blog, django, wordpress, multilingual',
|
keywords='djangocms-blog, blog, django, wordpress, multilingual',
|
||||||
|
test_suite='cms_helper.run',
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 4 - Beta',
|
'Development Status :: 4 - Beta',
|
||||||
'Framework :: Django',
|
'Framework :: Django',
|
||||||
|
|
|
@ -60,7 +60,8 @@ class AdminTest(BaseTest):
|
||||||
post_admin = admin.site._registry[Post]
|
post_admin = admin.site._registry[Post]
|
||||||
post_admin.add_view(request)
|
post_admin.add_view(request)
|
||||||
self.assertEqual(Post.objects.count(), 1)
|
self.assertEqual(Post.objects.count(), 1)
|
||||||
self.assertEqual(Post.objects.get(translations__slug='first-post').author_id, 1)
|
self.assertEqual(Post.objects.get(translations__slug='first-post').author_id,
|
||||||
|
request.user.pk)
|
||||||
|
|
||||||
with self.settings(BLOG_AUTHOR_DEFAULT=False):
|
with self.settings(BLOG_AUTHOR_DEFAULT=False):
|
||||||
data = deepcopy(self.data['en'][1])
|
data = deepcopy(self.data['en'][1])
|
||||||
|
|
9
tox.ini
9
tox.ini
|
@ -1,14 +1,13 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = {py26,py27}-django{15,16},{py27}-django{17}
|
envlist = py{26}-django{15,16},py{27,33,34}-django{15,16,17}
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
basepython =
|
# temporary fix for pip-setuptools / django CMS issues
|
||||||
py26: python2.6
|
install_command = ./tox_pip.sh {opts} {packages}
|
||||||
py27: python2.7
|
|
||||||
deps =
|
deps =
|
||||||
django15: Django>=1.5,<1.6
|
django15: Django>=1.5,<1.6
|
||||||
django16: Django>=1.6,<1.7
|
django16: Django>=1.6,<1.7
|
||||||
django17: Django>=1.7,<1.8
|
django17: Django>=1.7,<1.8
|
||||||
py26: unittest2
|
py26: unittest2
|
||||||
-r{toxinidir}/requirements-test.txt
|
-r{toxinidir}/requirements-test.txt
|
||||||
commands = djangocms-helper djangocms_blog test --cms --nose
|
commands = {env:COMMAND:python} setup.py test
|
||||||
|
|
3
tox_pip.sh
Executable file
3
tox_pip.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
pip install 'setuptools<8.0' 'pip<6'
|
||||||
|
pip install $@
|
Loading…
Reference in a new issue