django-jenkins Documentation

Similar documents
Tangent MicroServices Documentation

selenose Documentation

django-selenium Documentation

Django-frontend-notification Documentation

Continuous Integration INRIA

Building a Django Twilio Programmable Chat Application

django-teamwork Documentation

Deployability. of Python. web applications

DISQUS. Continuous Deployment Everything. David

Django Standalone Apps

Gunnery Documentation

Django IPRestrict Documentation

Django Map Widgets Documentation

neo4django Documentation

nacelle Documentation

Django Wordpress API Documentation

MapEntity Documentation

Graphene Documentation

Django Test Utils Documentation

ClickToCall SkypeTest Documentation

Java Program Structure and Eclipse. Overview. Eclipse Projects and Project Structure. COMP 210: Object-Oriented Programming Lecture Notes 1

django-geoip Documentation

Bitte decken Sie die schraffierte Fläche mit einem Bild ab. Please cover the shaded area with a picture. (24,4 x 7,6 cm)

open-helpdesk Documentation

KERNEL C.I. USING LINARO S AUTOMATED VALIDATION ARCHITECTURE. Wednesday, September 11, 13

django-celery Documentation

Tomasz Szumlak WFiIS AGH 23/10/2017, Kraków

Created by: Nicolas Melillo 4/2/2017 Elastic Beanstalk Free Tier Deployment Instructions 2017

Continuous Integration with Selenium and Jenkins

django-intercom Documentation

Easy-select2 Documentation

django-embed-video Documentation

JenkinsPipelineUnit. Test your Continuous Delivery Pipeline. Ozan Gunalp - Emmanuel Quincerot

Continuous Integration INRIA

DJOAuth2 Documentation

Django MFA Documentation

django-embed-video Documentation

django-dajax Documentation

Bishop Blanchet Intranet Documentation

Managing Dependencies and Runtime Security. ActiveState Deminar

Confire Documentation

Test-Driven Development with. Python. Harry Percival. Tokyo O'REILLY. Cambridge Farnham Koln Sebastopol. Beijing

Python-Django-DevOps Documentation

django-embed-video Documentation

Django-Style Flask. Cody Lee SCALE12x Feb 22, git clone

SLAM Documentation. Release 0.1 LAL

Mendeley. Citation Management Software

Continuous Integration (CI) with Jenkins

Python Unit Testing and CI Workflow. Tim Scott, Python Meetup 11/07/17

SagePay payment gateway package for django-oscar Documentation

django-ad-code Documentation

QGIS Script Assistant Plugin Documentation

django-cron Documentation

sainsmart Documentation

django-allauth-2fa Documentation

Briefcase Documentation

Continuous Delivery of your infrastructure. Christophe

django-facetools Documentation

Cookiecutter Django CMS Documentation

django simple pagination Documentation

#jenkinsconf. Managing jenkins with multiple components project. Jenkins User Conference Israel. Presenter Name Ohad Basan

Django CBTools Documentation

Support for disposable chroot environments (pbuilder), which can be very useful for C and C++ projects

Leveraging the OO Jenkins Plugin in DevOps scenarios

White Paper(Draft) Continuous Integration/Delivery/Deployment in Next Generation Data Integration

Python Development Workflow

Continuous integration & continuous delivery. COSC345 Software Engineering

Aldryn Installer Documentation

django-telegram-login Documentation

MIT AITI Python Software Development Lab DJ1:

How to write a well-behaved Python command line application. PyCon AU 2012 Tutorial Graeme Cross

The Nepomuk-WebMiner Handbook. Jörg Ehrichs

Django Groups Manager Documentation

Django Image Tools Documentation

Pipeline as Code for your IAC. Kris

SendCloud OpenCart 2 Extension Documentation

Django Groups Manager Documentation

Lotus IT Hub. Module-1: Python Foundation (Mandatory)

django-dajaxice Documentation

Getting Django Set Up Using a Functional Test

django-messages Documentation

Django-dbindexer Documentation

Django File Picker Documentation

Django QR Code Documentation

Trunk Player Documentation

Django_template3d Documentation

PyBuilder Documentation

Bambu API Documentation

CIS192 Python Programming

EDPC Mentoring Database Documentation

HOW WE MOVED FROM JAVA TO SCALA

Biostar Central Documentation. Release latest

django-stored-messages Documentation

Avoiding regressions in an agile development environment. At Yottaa

Sync Your Contacts and Events with Lightning Sync

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

Django Mail Queue Documentation

Installation and Release Notes

Con. Continuous Integration

sptrans Documentation

Transcription:

django-jenkins Documentation Release 0.19.0 Mikhail Podgurskiy, Gabriel Le Breton Jun 04, 2017

Contents 1 Indices and tables 3 2 Getting started 5 2.1 Configuring django project........................................ 5 2.2 Configuring jenkins........................................... 6 2.3 Results.................................................. 9 i

ii

Plug and play continuous integration with django and jenkins There are a lot of ways to enable continuous integration with your django project. But most of them require a lot of time to configure and setup ci server and make changes in your django project. This tutorial introduces a new way to enable continuous integration for django project, with minimal projects modifications by means of with django-jenkins. Previously, ad-hoc integration django with jenkins required using nose testing frameworks instead of django native unittests. Since nose project uses custom test loader it leads to a lot of problems with django code - duplicate signals subscriptions, module loading and other test-only realted errors. Django-jenkins uses a standard unittest runner, so the code under test works like in production. No difference between django-jenkins run and manage.py test so keeps your hands free for real work. Contents 1

2 Contents

CHAPTER 1 Indices and tables genindex search 3

4 Chapter 1. Indices and tables

CHAPTER 2 Getting started Configuring django project To enable django_jenkins you need only to add django_jenkins to INSTALLED_APPS in settings.py. Running $ python manage.py jenkins will do the same job as $ python manage.py tests but also will create reports folder in the root of your django project with jenkins parsable pylint, test coverage and tests reports. Django-jenkins have support for several other testing tools/ To enable it, you should include tools task to JENKINS_TASKS settings variable. JENKINS_TASKS = ( 'django_jenkins.tasks.run_pep8', 'django_jenkins.tasks.run_pyflakes', 'django_jenkins.tasks.run_jslint', 'django_jenkins.tasks.run_csslint', 'django_jenkins.tasks.run_sloccount' ) Please, note that corresponding task tool should be installed on jenkins server manually. Please refer to django-jenkins README for specific task dependencies list. In order to get the right coverage, 'django_jenkins' app should be included as early as possible in INSTALLED_APPS This tutorial doesn t cover the library dependency management and deploying your django project on external server. Basically you could setup the CI server as you did in your local environment. 5

But if you prefer automatically installation and configuration dependencies on CI server, you could easily add virtalenv support for your project. Add requirements to your requirements.txt file: Django django-jenkins # any other libraries for your project Running $ virtualenv --python=python2.6 env $ env/bin/pip install -r requirements.txt will create local folder env with the required libraries for your project. Running those commands on other servers will help to sync the external dependencies. Configuring jenkins After a fresh Jenkins installation, you ll need to install two required plugins: Violations plugin for parsing pylint reports and Cobertura Plugin for showing the code coverage. Install these plugins via Manage Jenkins -> Manage Plugins -> Available. Start new job with creating free-style project: After configuring the repository access, set up the build trigers. Poll SCM will run the build if any changes in repository are found. The line */5 * * * * means checking repository every 5 minutes. 6 Chapter 2. Getting started

Select Add build step -> Execute shell. Add comands to setup environment and the run tests command $ python manage.py jenkins --enable-coverage.. image:: _static/jenkins-2.png Specify the location of test reports - reports/test-*.xml and reports/lettuce.xml (in case you are using lettuce tests) files. CHANGED in 0.13.0:: test reports from TEST-*.xml now stored in one file: junit.xml. 2.2. Configuring jenkins 7

Configure locations of violations reports: 8 Chapter 2. Getting started

Test coverage reports are in reports/coverage.xml That s all! Results Press Build Now and see what you ve got: Pylint and other lint tools reports for each builds, shows what warning/errors are new for each build. 2.3. Results 9

Nice code coverage reports, showing the total coverage, and colored file listing. 10 Chapter 2. Getting started

And of course the test results and output. 2.3. Results 11

12 Chapter 2. Getting started