Plug and play continuous integration with Django and Jenkins
From PyPI:
$ pip install django-jenkins
Or by downloading the source and running:
$ python setup.py install
For the latest git version, you need the latest pip installed first:
$ pip install git+https://github.com/pypa/pip.git $ pip install -e git+git://github.com/kmmbvnr/django-jenkins.git#egg=django-jenkins
Installation for Python 3:
$ pip install git+https://github.com/django/django.git $ pip install hg+http://hg.logilab.org/pylint $ pip install coverage $ # if required $ pip install pyflakes3k $ pip install pep8 $ # lettuce and selenium are not yet ported to python 3k
And then, upgrade the pip and install django-jenkins from git as described above.
Add 'django_jenkins' to your INSTALLED_APPS list.
Configure Jenkins to run the following command:
$ ./manage.py jenkins
This will create reports/ directory with junit xml, Coverage and Pylint reports.
For more details see the generic tutorial: https://sites.google.com/site/kmmbvnr/home/django-jenkins-tutorial or tutorial for running django-jenkins on ShiningPanda CI https://docs.shiningpanda.com/tutorials/multi-databases/project.html
PROJECT_APPSIf present, it is supposed to be a list/tuple of django apps for Jenkins to run. Tests, reports, and coverage are generated only for the apps from this list. You should specify --all option to ignore this setting.
JENKINS_TASKSList of Jenkins tasks executed by
./manage.py jenkinscommand.Default value:
JENKINS_TASKS = ( 'django_jenkins.tasks.run_pylint', 'django_jenkins.tasks.with_coverage', 'django_jenkins.tasks.django_tests', )JENKINS_TEST_RUNNERThe name of the class to use for starting the test suite for
jenkinsandjtestcommands. Class should be inherited fromdjango_jenkins.runner.CITestSuiteRunnerA runner has been added for people using nose in their project. This runner is using django_nose so you will need to have that installed if you want to use this runner.:
JENKINS_TEST_RUNNER='django_jenkins.nose_runner.CINoseTestSuiteRunner'
Here is the list of tasks prebuild with django-jenkins
django_jenkins.tasks.run_pylintRuns Pylint over selected Django apps.
Task-specific settings:
PYLINT_RCFILE
django_jenkins.tasks.with_coverageProduces XML coverage report for Jenkins
Task-specific settings:
COVERAGE_RCFILE,COVERAGE_REPORT_HTML_OUTPUT_DIR,COVERAGE_MEASURE_BRANCH,COVERAGE_EXCLUDES,COVERAGE_WITH_MIGRATIONS,COVERAGE_EXCLUDES_FOLDERSdjango_jenkins.tasks.django_testsDiscovers standard Django test suite from test.py files
django_jenkins.tasks.dir_testsDiscover tests from all test*.py files in app subdirectories
django_jenkins.tasks.run_jshintRuns jshint tools over
<app>/static/*/*.jsfiles. Creates Pylint compatible report for JenkinsYou should have the jshint installed
django_jenkins.tasks.run_csslintRuns CSS lint tools over app/static/*/*.css files. Creates CSS Lint compatible report for Jenkins
You should have the csslint installed
Task-specific settings:
CSSLINT_INTERPRETER,CSSLINT_CHECKED_FILES
django_jenkins.tasks.run_pep8Runs pep8 tool over selected Django apps. Creates Pylint compatible report for Jenkins
You should have pep8 python package (>=1.3) installed to run this task.
Task-specific settings:
PEP8_RCFILE
django_jenkins.tasks.run_pyflakesRuns Pyflakes tool over selected Django apps. Creates Pylint compatible report for Jenkins.
You should have Pyflakes python package installed to run this task.
django_jenkins.tasks.run_flake8Runs flake8 tool over selected Django apps. Creates Pylint compatible report for Jenkins.
You should have flake8 python package installed to run this task.
django_jenkins.tasks.run_sloccountRuns SLOCCount tool over selected Django apps. Creates sloccount plugin compatible report for Jenkins.
You should have the SLOCCount program installed to run this task.
django_jenkins.tasks.run_graphmodelsGraphs an overview of the models of the selected Django apps. Creates
models.pnggraphic (example).You should have django-extensions and pygraphviz installed to run this task.
Task-specific settings:
GRAPH_MODELS: A dictionary of settings for graph_models, most corresponding to the command-line options (with 'graphmodels_' removed):fail_without_error,disable_fields,group_models,all_applications,outputfile,layout,verbose_names,language,exclude_columns,exclude_models,inheritance
django_jenkins.tasks.lettuce_testsDiscover Lettuce tests from app/feature directories.
You should have the Lettuce Python package installed to run this task.
django_jenkins.tasks.with_local_celeryReplacement for
djcelery.tests.runners.CeleryTestSuiteRunnerChange settings for run Celery tasks locally.
django_jenkins.tasks.behave_testsDiscover Behave tests from app/features directories.
You should have the Behave Python package installed to run this task.
- Django 1.6 compatibility
- Flake8 support
- Pep8 file configuration support
- CSSLint no longer shipped with django-jenkins. Install it with
npm install csslint -g
- Python 3 (with django 1.5) support
- JSHint no longer shipped with django-jenkins. Install it with
npm install jshint -g
- unittest2 compatibility
- WARNING: Junit test data now stored in one junit.xml file
- Support for pep8 1.3
- New in-directory test discovery task
- Added --liveserver option
- Fixes in jslint and csslint tasks
- Added Celery task
- Add nodejs support for jslint and csslint tasks
- Improve js and css files selection
- Bug fixes
- Django 1.3 in requirements
- Windmill support was removed (Django 1.4 has a better implementation)
- Ignore South migrations by default
- Added SLOCCount task
- Added Lettuce testing task
- Added CSS Lint task
- Used xml output format for jslint
- Used native pep8 output format
- Do not produce file reports for jtest command by default
- Ignore Django apps without models.py file, as in Django test command
- Fix jslint_runner.js packaging
- Fix coverage file filtering
- Support pep8, Pyflakes, jslint tools
- Added jtest command
- Allow specify custom test runner
- Various fixes, thnk githubbers :)
- Pluggable ci tasks refactoring
- Alpha support for windmill tests
- Partial python 2.4 compatibility
- Renamed to django-jenkins
- Python 2.5 compatibility
- Make compatible with latest Pylint only
- Initial public release
Mikhail Podgurskiy <kmmbvnr@gmail.com>
Contributors:
- Chris Heisel (https://github.com/cmheisel)
- Andrey Fedoseev (https://github.com/andreyfedoseev)
- Jannis Leidel (https://github.com/jezdez)
- Luciano Pacheco (https://github.com/lucmult)
- Julien Lirochon (https://github.com/jlirochon)
- Olivier Girardot (https://github.com/ssaboum)
- Victor Safronovich (https://github.com/suvit)
- Bradley Ayers (https://github.com/bradleyayers)
- Jonas Obrist (https://github.com/ojii)
- John Paulett (https://github.com/johnpaulett)
- Michael Ellingen (https://github.com/mvantellingen)
- Domen Kožar (https://github.com/iElectric)
- Simon Panay (https://github.com/simonpanay)
- Tom Mortimer-Jones (https://github.com/morty)
- Philip Kimmey (https://github.com/philipkimmey)
- Peter Baumgartner (https://github.com/ipmb)
- Kris Kumler (https://github.com/kkumler)
- Axel Haustant (https://github.com/noirbizarre)
Special thanks, for all github forks authors not listed here for project extensions ideas and problem identifications.