Update fabfile to reinsert coverage plain report to travis

This commit is contained in:
Norman Jäckel 2013-04-16 14:37:27 +02:00
parent ebda7ed0d2
commit fc1ef2b506

30
fabfile.py vendored
View File

@ -16,18 +16,28 @@ from fabric.contrib import django
def test(module='tests'): def test(module='tests'):
""" """
Runs all unit tests for OpenSlides using coverage. The settings file Runs all unit tests for OpenSlides using coverage.
in the tests directory is used, therefor the environment
variable DJANGO_SETTINGS_MODULE is set to 'tests.settings'. The settings file in the tests directory is used, therefor the
environment variable DJANGO_SETTINGS_MODULE is set to 'tests.settings'.
""" """
django.settings_module('tests.settings') django.settings_module('tests.settings')
local('coverage run ./manage.py test %s' % module) local('coverage run ./manage.py test %s' % module)
def coverage_report_plain():
"""
Runs all tests and prints the coverage report.
"""
test()
local('coverage report -m')
def coverage(): def coverage():
""" """
Runs all tests and builds the coverage html files. The index of these Runs all tests and builds the coverage html files.
files is opened in the end.
The index of these files is opened in the webbrowser in the end.
""" """
test() test()
local('coverage html') local('coverage html')
@ -44,15 +54,17 @@ def pep8():
def prepare_commit(): def prepare_commit():
""" """
Does everything before a commit should be done. At the moment it Does everything before a commit should be done.
does the same as travis_ci()
At the moment it is running the tests and check for PEP 8 errors.
""" """
travis_ci() test()
pep8()
def travis_ci(): def travis_ci():
""" """
Command that is run by Travis CI. Command that is run by Travis CI.
""" """
test() coverage_report_plain()
pep8() pep8()