Move test_jenkins configuration into awx/settings/jenkins.py

This commit is contained in:
James Laska 2014-06-05 13:59:43 -04:00
parent fb62eebe8c
commit 296917af54
3 changed files with 42 additions and 25 deletions

View File

@ -175,7 +175,7 @@ test_tox:
# Run unit tests to produce output for Jenkins.
test_jenkins:
$(PYTHON) manage.py jenkins -v2
DJANGO_SETTINGS_MODULE="awx.settings.jenkins" $(PYTHON) manage.py jenkins -v2
package.json:
sed -e 's/%NAME%/$(NAME)/;s/%VERSION%/$(VERSION)/' packaging/grunt/package.template > $@

View File

@ -272,14 +272,6 @@ DEVSERVER_MODULES = (
#'devserver.modules.profile.LineProfilerModule',
)
# Use Django-Jenkins if installed. Only run tests for awx.main app.
try:
import django_jenkins
INSTALLED_APPS += ('django_jenkins',)
PROJECT_APPS = ('awx.main', 'awx.api',)
except ImportError:
pass
# Set default ports for live server tests.
os.environ.setdefault('DJANGO_LIVE_TEST_SERVER_ADDRESS', 'localhost:9013-9199')
@ -497,19 +489,3 @@ LOGGING = {
},
}
}
if 'django_jenkins' in INSTALLED_APPS:
JENKINS_TASKS = (
'django_jenkins.tasks.run_pylint',
'django_jenkins.tasks.with_coverage',
'django_jenkins.tasks.django_tests',
'django_jenkins.tasks.run_pep8',
'django_jenkins.tasks.run_pyflakes',
'django_jenkins.tasks.run_jshint',
'django_jenkins.tasks.run_csslint',
)
PEP8_RCFILE = "setup.cfg"
CSSLINT_CHECKED_FILES = [os.path.join(BASE_DIR, 'ui/static/less')]
JSHINT_CHECKED_FILES = [os.path.join(BASE_DIR, 'ui/static/js'),
os.path.join(BASE_DIR, 'ui/static/lib/ansible'),]

41
awx/settings/jenkins.py Normal file
View File

@ -0,0 +1,41 @@
# Copyright (c) 2014 AnsibleWorks, Inc.
# All Rights Reserved.
# Test settings for AWX project.
# Python
import sys
import traceback
# Django Split Settings
from split_settings.tools import optional, include
# Load development settings.
from defaults import *
# Load development settings.
from development import *
# Disable capturing DEBUG
DEBUG = False
TEMPLATE_DEBUG = DEBUG
SQL_DEBUG = DEBUG
# Use Django-Jenkins if installed. Only run tests for awx.main app.
import django_jenkins
INSTALLED_APPS += ('django_jenkins',)
PROJECT_APPS = ('awx.main', 'awx.api',)
JENKINS_TASKS = (
'django_jenkins.tasks.run_pylint',
'django_jenkins.tasks.with_coverage',
'django_jenkins.tasks.django_tests',
'django_jenkins.tasks.run_pep8',
'django_jenkins.tasks.run_pyflakes',
'django_jenkins.tasks.run_jshint',
'django_jenkins.tasks.run_csslint',
)
PEP8_RCFILE = "setup.cfg"
CSSLINT_CHECKED_FILES = [os.path.join(BASE_DIR, 'ui/static/less/*.less')]
JSHINT_CHECKED_FILES = [os.path.join(BASE_DIR, 'ui/static/js'),
os.path.join(BASE_DIR, 'ui/static/lib/ansible'),]