Commit 4102b003 authored by Michal Čihař's avatar Michal Čihař

Add cleanup task to jenkins testsuite

Otherwise stats like sloccount are polluted with test repos.
parent 2b2662f8
# -*- 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/>.
#
'''
Cleanup task for Jenkins CI
'''
from django_jenkins.tasks import BaseTask
from django.conf import settings
import os
class Task(BaseTask):
def teardown_test_environment(self, **kwargs):
'''
Remove test repos before collecting code stats.
The test-repos just pollute stats.
'''
if 'test-repos' in settings.GIT_ROOT:
if os.path.exists(settings.GIT_ROOT):
shutil.rmtree(settings.GIT_ROOT)
......@@ -28,6 +28,7 @@ import os
INSTALLED_APPS += ('django_jenkins', )
JENKINS_TASKS = (
'weblate.jenkins_cleanup',
'django_jenkins.tasks.run_pylint',
'django_jenkins.tasks.run_pyflakes',
'django_jenkins.tasks.run_sloccount',
......
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