SlideShare une entreprise Scribd logo
1  sur  109
Télécharger pour lire hors ligne
Continuous Integration Testing
Django Boston Meetup
24 April 2014
Kevin Harvey
@kevinharvey
kevin@storyandstructure.com
Who is this guy?
Who is this guy?
Fast Slow
Unit Functional
• Chief Technologist at Story+Structure
• Djangonaut since 2007 (0.96)
Here’s the best $24 I ever spent.
What are we doing?
Agenda
• What is Continuous Integration?
• Why use Continuous Integration?
• CI in Practice: Travis
• Coverage Thresholds with coverage.py
• CI in Practice: Jenkins
• Best Practices & Further Exploration
What is CI?
Continuous Integration is like having a tireless robot that cleans up after you.
What is CI?
1. Checkout out the latest copy of your code
2. Install the dependencies
3. Run the tests
4. Report the outcome
Some server somewhere checks out your code, installs all your dependencies, runs your tests, and let’s
you know if it worked or not.
Testing in Django
# jmad/tunes/tests/test_views.py
from django.test import TestCase
class TunesViewTestCase(TestCase):
def test_index_view(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'index.html')
Here’s a quick primer on Django tests, for the uninitiated.
Testing in Django
# jmad/tunes/views/__init__.py
from django.views.generic import TemplateView
class IndexView(TemplateView):
template_name = "index.html"
# jmad/jmad/urls.py
from django.conf.urls import patterns, url
from tunes.views import IndexView
urlpatterns = patterns('',
url(r'^$', IndexView.as_view(), name='index'),
)
Here’s the code to make that test pass (assuming there’s an index.html in a template directory
somewhere).
Testing in Django
$ python manage.py test
.
---------------------------------------------------------------
-------
Ran 1 test in 0.029s
OK
Destroying test database for alias 'default'...
$
And here’s how you’d run the test suite for the project.
Why CI?
Why CI?
Drink more beer.
How can I drink more beer if the client calls me on Saturday night because the site is down?Bugs
should show up fast, and you should fix them before your code is deployed.
Why CI?
Your test suite is only useful if you run it.
You will forget to run your tests. Your collaborators will forget to run your tests. If you don’t run the
tests, you won’t know your code is busted when it’s time to deploy.
Why CI?
I run tests with SQLite, d@&$#t.
It’s fast. It’s there. If I want to build my project on my mom’s Mac Mini I don’t have to install
homebrew. Plus, running a test suite creates a new database everytime. Let the m1.small sitting in
Northern Virginia wait around for TestCase to create the PostgreSQL database. It doesn’t even like
beer.
Why CI?
Your project is not getting deployed to a Macbook.
Having said that, you need to run your tests in an environment like your production environment. Your
project may have wacky dependencies that you installed a long time ago on your Macbook.
Why CI?
Know immediately if you can’t install a package
Why CI?
# requirements.txt
...
PIL=1.1.7 # need to redeploy?
The time to learn about a neat new package replacing an old clunky one is NOT when you’re trying to
do an emergency redeployment.
Our example project
JMAD
The Jazz Musicianship Archive and Database
http://jmad.us
code: https://github.com/kcharvey/jmad
The Jazz Musicianship Archive and Database
http://jmad.us
I’m a bass player, I play some jazz.
http://www.scu.edu/profiles/?p=5184
More importantly, I know Bill Stevens. He’s jazz faculty at Santa Clara University. He wrote a book
called “Jazz Musicianship”. It’s a guide for jazz improvisation based on patterns that exists in many
different jazz tunes.
While we read headings like “Adding Callables to ModelAdmin Classes”...
... his headings are like “Engaging the Bebop Principle”.
Screenshot
JMAD is an archive of jazz music that’s been tagged with these different musical concepts. Basically
you search by concept, instrument, difficulty, etc., and you get back solos with those parameters
CI in Practice: Travis
Travis
• http://travis-ci.org
• It’s where all these come from:
Travis: Setup
1. Sign in with your Github account
2. Select the repos you want Travis to work on
3. Add a .travis.yml file to the root of the repo
4. Commit
Travis: Basic .travis.yml
language: python
python:
  - "3.3"
  - "2.7"
# command to install dependencies
install:
  - "pip install -r requirements/ci.txt"
# command to run tests
script: "python manage.py test"
Travis: Egg .travis.yml
language: python
python:
  - "3.3"
  - "2.7"
# command to install dependencies
install:
  - "pip install -r requirements/ci.txt"
  - "pip install ."
# command to run tests
script: "cd testproject;python manage.py test
myapp"
Travis: Pros
SaaS
No server to set up, no apt-getting anything ever. It’s just there.
Travis: Pros
Free as in “free beer” (for public repos)
Travis: Pros
Config is maintained very obviously in Git
Explicit, no implicit.
Travis: Pros
Cool little badgy thingy.
Impress your hacker friends with your TDD prowess.
Travis: Pros
Unbelievably, stupidly easy.
Travis: Pros
Just do it, even if you don’t have any tests.
It will still check your requirements and build your app.
Travis: Cons
Hope you’re using GitHub.
Maybe there’s a way to use non-GitHub repos, but I’ll be damned if it’s documented anywhere.
Travis: Cons
You’re stuck with their architecture.
For instance, when I was putting this app together they didn’t have Python 3.4 yet.
coverage.py
coverage.py is a utility created by Boston’s own Ned Batchelder.
coverage.py
How much of my code is not covered by tests?
It answers this question.
coverage.py
$ coverage run --source='.' manage.py test --settings=jmad.settings.base
Creating test database for alias 'default'...
...E
...
----------------------------------------------------------
Ran 4 tests in 3.353s
FAILED (errors=1)
Destroying test database for alias 'default'...
Run your tests with coverage...
coverage.py
$ coverage report --omit=*test*,*settings*
Name Stmts Miss Cover
-------------------------------------------------
jmad/__init__ 0 0 100%
jmad/urls 6 0 100%
jmad/wsgi 4 4 0%
manage 6 0 100%
people/__init__ 0 0 100%
people/admin 1 0 100%
people/models 1 0 100%
people/views/__init__ 4 0 100%
tunes/__init__ 0 0 100%
tunes/admin 1 0 100%
tunes/models 1 0 100%
tunes/templatetags/__init__ 0 0 100%
tunes/templatetags/add_css 5 0 100%
tunes/urls 3 0 100%
tunes/views/__init__ 5 0 100%
-------------------------------------------------
TOTAL 37 4 89%
... then generate a report to see what’s not being tested.
coverage.py
$ coverage report --omit=*test*,*settings*
So let’s take a closer look at the report command
coverage.py
$ coverage report --omit=*test*,*settings*
--omit tells coverage to not report on a few things. Since we have multiple settings files, and we don’t
test our tests, we omit them both.
coverage.py
$ coverage report --omit=*test*,*settings* --fail-under=85
--fail-under take an integer, and compares that to the total percentage of coverage, and makes this
command return a 2 (anything but 0 is failure).
Travis and coverage.py
language: python
python:
  - "3.3"
  - "2.7"
# command to install dependencies
install:
  - "pip install -r requirements/ci.txt"
# command to run tests
script:
  - "coverage run source=’.’ manage.py test"
  - "coverage report --omit=*settings*,*test*
--fail-under=85" # 85% coverage minimum
Swap out your script with these two lines: one to run the tests with coverage, and the other to run a
report that can fail. Now if we’re at 85% coverage and someone pushes new code without test
coverage, we’ll drop below 85% and get a failed build.
coverage.py
“Code without tests is broken by design.”
-- Jacob Kaplan-Moss
This is a good thing.
CI in Practice: Jenkins
Jenkins
• http://jenkins-ci.org/
• Django’s Jenkins: http://ci.djangoproject.com/
Installing Jenkins
$ wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war
$ java -jar jenkins.war
http://localhost:8080
Just get the .war file, run it, and hit port 8080 on your machine. You could deploy it behind Tomcat or
the like.
Or grab a VM
Installing Jenkins
I used a TurnKey Linux prebuilt VM.
Configuring Jenkins
You’ll need some plugins:
- Jenkins Violations Plugin
- Jenkins Git Plugin
- Jenkins Cobertura Plugin
Install a few plugins.
Configuring Jenkins
Got Selenium tests?
So, if you’re like me, you’ve got Jenkins on a headless version of Linux. We’ll have to do some magic to
get our Selenium tests to run.
Configuring Jenkins
# on the Jenkins box
$ sudo apt-get install iceweasel # install firefox
$ sudo apt-get install xvfb # frame buffer emulator
Install firefox (the package is called iceweasel for some reason).
Configuring Jenkins
# /etc/init.d/xvfb
#!/bin/bash
if [ -z "$1" ]; then
echo "`basename $0` {start|stop}"
exit
fi
case "$1" in
start)
/usr/bin/Xvfb :99 -ac -screen 0 1024x768x8 &
;;
stop)
killall Xvfb
;;
esac
Configure xvfb to run when the server starts
Configuring Jenkins
$ sudo chmod 755 /etc/init.d/xvfb
$ sudo shutdown -r now
make that file executable, and restart the server
Configuring Jenkins
$ pip install django-jenkins
INSTALLED_APPS = (
...
'django_jenkins',
)
...
JENKINS_TASKS = (
'django_jenkins.tasks.run_pylint',
'django_jenkins.tasks.with_coverage',
'django_jenkins.tasks.run_pep8',
# there are more of these
)
$ python manage.py jenkins # Jenkins will run this command
django-jenkins is a plugin that runs out tests and outputs the files Jenkins needs to show our build
stats. pip install and add some stuff to your settings.py
Configuring Jenkins
1. Configure a new test (name, description)
2. Give it your repo URL
3. Tell it how often to build
4. Tell it the commands to run
5. Configure where to save the reports
6. Click “Build Now”
Check out the tutorials in the “Resources” section of this slide deck for more on configuring your repo.
It’ll take about 15 minutes the first time.
Configuring Jenkins
#!/bin/bash
virtualenv -p python3.4 env
env/bin/pip install -r requirements/ci.txt
export SECRET_KEY='dnqsj22jdv9wjsldfub9'
export DISPLAY=:99
env/bin/python manage.py jenkins --settings=jmad.settings.ci
here’s what that command really should be
So what did we get?
Jenkins
I used a TurnKey Linux prebuilt VM.
Here’s a list of all the projects Jenkins knows to build
The project page for JMAD. Note the historic list of builds at the bottom left.
An individual build. That’s a list of commit messages under ‘changes’. And the link to the console
output.
Logged output
The workspace it built.
Latest test result
Free as in beer and speech
Jenkins: Pros
Open. Extensible. Good for the spirit.
Plugins install like Wordpress
Jenkins: Pros
And by that I mean, it’s almost *too* easy. Just search for them from your installation and click
“install”.
Distributed builds
Jenkins: Pros
I haven’t done any work with this at all, but Jenkins supports a ‘master/slave’ mode, allowing a single
Jenkins instance to control many others. This would allow you to test a project on a bunch of different
platforms simultaneously. You can see how that would benefit the Django project itself, or other large
Python packages.
It’s your architecture.
Jenkins: Pros
Need to run Python compiled with some magical incantation? Need a special server utility installed?
Jenkins runs on an OS you control, so do what you gotta do.
It’s nobody else’s architecture.
Jenkins: Cons
That, of course, leads to our first con.
To paraphrase Uncle Ben, “With great power can come a whole lot of bullshit.”
15 apt-get update
16 sudo apt-get install build-essential
17 apt-get install build-essential
18 apt-get install libsqlite3-dev
19 apt-get install sqlite3
20 apt-get install bzip2 libbz2-dev
21 ls
22 ls ..
23 mkdir src
24 cd src/
25 wget http://www.python.org/ftp/python/3.4.0/Python-3.4.0.tar.xz
26 tar xJf ./Python-3.4.0.tar.xz
27 cd Python-3.4.0/
28 ./configure --prefix=/opt/python3.4
29 make && make install
30 python3.4
31 ln -s /opt/python3.4/bin/python3.4 ~/bin/python3.4
32 ls ~
33 mkdir bin
34 ln -s /opt/python3.4/bin/python3.4 ~/bin/python3.4
35 ls
Jenkins: Cons
Here’s the first twenty lines of me fumbling through installing Python 3.4, pip, and virtualenv
36 ls bin
37 rm -rf bin
38 mkdir ~/bin
39 ln -s /opt/python3.4/bin/python3.4 ~/bin/python3.4
40 python2.4
41 python3.4
42 virtualenv
43 ls /opt/python3.4/bin/
44 cd
45 ls
46 ls bin/
47 bin/python3.4
48 python3.4
49 ls /usr/bin/
50 ln -s /opt/python3.4/bin/python3.4 /usr/bin/python3.4
51 python3.4
52 rm -rf bin/
53 wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
54 python3.4 get-pip.py
55 apt-get install zlib
56 apt-get install zlib1g
Jenkins: Cons
... and here’s the next twenty lines...
57 python3.4 get-pip.py
58 apt-get install zlib1g
59 apt-get install zlib-dev
60 apt-get install zlibc
61 python3.4 get-pip.py
62 apt-get install zlib1g-dev
63 python3.4 get-pip.py
64 apt-get install zlib-bin
65 python3.4 get-pip.
66 python3.4 get-pip.py
67 cd src/
68 ls
69 cd Python-3.4.0/
70 history
71 ./configure --prefix=/opt/python3.4
72 make && make install
73 apt-get install libssl-dev openssl
74 make && make install
75 which pip
76 cd ~
77 ln -s /opt/python3.4/bin/pip3.4 /usr/bin/pip3.4
78 pip3.4 install virtualenv
Jenkins: Cons
... and the next. So you’ll need some sysadmin chops.
And I still need to set up a mail server.
Jenkins: Cons
Git is a plugin
Jenkins: Cons
Again, it’s not hard to install plugins, but other tools are Git-centric, so it’s worth mentioning.
Best Practices
Best Practices
Use multiple settings.py and requirements.txt files
Best Practices
# jmad/settings/ci.py
INSTALLED_APPS = (
...
‘django_jenkins’
)
...
JENKINS_TASKS = (
‘django_jenkins.tasks.run_pylint’,
‘django_jenkins.tasks.with_coverage’,
‘django_jenkins.tasks.run_pep8’
)
Keep this stuff out of your production app (and your dev environment, for that matter).
Best Practices
# requirements/ci.txt
...
coverage==3.7.1 # duped in dev.txt
django_jenkins==0.15.0
pep8==1.5.6
(and your dev environment, for that matter).
Best Practices
Rebuild your env in Jenkins
Best Practices
#!/bin/bash
rm -rf env
virtualenv -p python2.7 env
env/bin/pip install -r requirements/ci.txt
export SECRET_KEY='dnqsj22jdv9wjsldfub9'
env/bin/python manage.py jenkins --settings=jmad.settings.ci
Toss the old env before you recreate it.
Further Exploration
“Just-in-time Jenkins”
a.k.a.
“The AWS Miser”
a.k.a
“Big Testing”
Further Exploration
You could imagine a scenario in which, using one of the many DevOps tools available, you spin up and
AWS instance, install and configure Jenkins, set up your tests, report and then tear down the box. This
would be particularly useful if you wanted to test on a multidtude of platforms but didn’t want to pay
to keep them all up all the time.
Alternatives to Travis
• https://circleci.com/
• https://drone.io/
Further Exploration
Travis is not the only SaaS CI game in town. Drone.io works with BitBucket.
tox
Further Exploration
It’s a tool to test your project in multiple version of Python in one go, and can act as a front end to a CI
server. Has anyone here used tox?
django-jenkins Tasks
There are a number of tasks available in django-jenkins that I haven’t showed you yet.
django_jenkins.tasks.run_jshint
django_jenkins.tasks.run_csslint
django-jenkins Tasks
Runs jshint or csshint tools of your static directory, and produces reports that work in Jenkins. You’ll
need to install jshint/csslint on the box that Jenkins is running on.
django_jenkins.tasks.run_pyflakes
django-jenkins Tasks
If you’re using Pyflakes, django-jenkins has you covered. Add Pyflakes to you requirements/ci.txt file.
django_jenkins.tasks.run_flake8
django-jenkins Tasks
Same deal with flake8. You’re beginning to see how jenkins is trying to fit in with whatever testing
tools you’re already using.
django_jenkins.tasks.run_sloccount
django-jenkins Tasks
SLOCCount is a utility for counting lines of code. The developer missed a big opportunity to call his
project SLOCConut, IMHO. Install SLOCCount on the server to get this one going.
django_jenkins.tasks.run_sloccount
django-jenkins Tasks
SLOCCount is a utility for counting lines of code. The developer missed a big opportunity to call his
project SLOCConut, IMHO. Install SLOCCount on the server to get this one going.
django_jenkins.tasks.run_graphmodels
django-jenkins Tasks
You can also let Jenkins graph your models for you.
You need django-extensions and pygraphviz in your CI requirements for this one to work.
django_jenkins.tasks.with_local_celery
django-jenkins Tasks
Django Jenkins also provides a test runner to run your tests with Celery, if you’re in to that sort of
thing.
Thanks!
@kevinharvey
github.com/kcharvey
Questions?
@kevinharvey
github.com/kcharvey
Show of hands: if your boss/client/conscience dictated that you had to implement CI tomorrow, would
you use one of the hosted/SaaS tools or go with Jenkins?
Resources
Setting up Jenkins for Selenium tests
• http://www.labelmedia.co.uk/blog/setting-up-
selenium-server-on-a-headless-jenkins-ci-build-
machine.html
• http://www.installationpage.com/selenium/how-
to-run-selenium-headless-firefox-in-ubuntu/
• Just Google it

Contenu connexe

Tendances

Five Easy Ways to QA Your Drupal Site
Five Easy Ways to QA Your Drupal SiteFive Easy Ways to QA Your Drupal Site
Five Easy Ways to QA Your Drupal SiteMediacurrent
 
Unit testing @ WordPress Meetup Tilburg 7 januari 2014
Unit testing @ WordPress Meetup Tilburg 7 januari 2014Unit testing @ WordPress Meetup Tilburg 7 januari 2014
Unit testing @ WordPress Meetup Tilburg 7 januari 2014Barry Kooij
 
Continuous Integration & Drupal
Continuous Integration & DrupalContinuous Integration & Drupal
Continuous Integration & DrupalLimoenGroen
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamJoe Ferguson
 
Das Frontend richtig Testen – mit Jest @Developer Week 2018
Das Frontend richtig Testen – mit Jest @Developer Week 2018Das Frontend richtig Testen – mit Jest @Developer Week 2018
Das Frontend richtig Testen – mit Jest @Developer Week 2018Holger Grosse-Plankermann
 
How do I Write Testable Javascript so I can Test my CF API on Server and Client
How do I Write Testable Javascript so I can Test my CF API on Server and ClientHow do I Write Testable Javascript so I can Test my CF API on Server and Client
How do I Write Testable Javascript so I can Test my CF API on Server and ClientColdFusionConference
 
Building JBoss AS 7 for Fedora
Building JBoss AS 7 for FedoraBuilding JBoss AS 7 for Fedora
Building JBoss AS 7 for Fedorawolfc71
 
Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018Holger Grosse-Plankermann
 
Selenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web ApplicationsSelenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web Applicationsqooxdoo
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toNicolas Fränkel
 
Unit testing plugins: The 5 W's and an H
Unit testing plugins: The 5 W's and an HUnit testing plugins: The 5 W's and an H
Unit testing plugins: The 5 W's and an HTom Jenkins
 
Getting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalGetting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalPhilip Norton
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Tom Brander
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David TorroijaDavid Torroija
 
Testing Django Applications
Testing Django ApplicationsTesting Django Applications
Testing Django ApplicationsHonza Král
 

Tendances (20)

Five Easy Ways to QA Your Drupal Site
Five Easy Ways to QA Your Drupal SiteFive Easy Ways to QA Your Drupal Site
Five Easy Ways to QA Your Drupal Site
 
Unit testing @ WordPress Meetup Tilburg 7 januari 2014
Unit testing @ WordPress Meetup Tilburg 7 januari 2014Unit testing @ WordPress Meetup Tilburg 7 januari 2014
Unit testing @ WordPress Meetup Tilburg 7 januari 2014
 
Continuous Integration & Drupal
Continuous Integration & DrupalContinuous Integration & Drupal
Continuous Integration & Drupal
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small team
 
Node.js vs Play Framework
Node.js vs Play FrameworkNode.js vs Play Framework
Node.js vs Play Framework
 
Das Frontend richtig Testen – mit Jest @Developer Week 2018
Das Frontend richtig Testen – mit Jest @Developer Week 2018Das Frontend richtig Testen – mit Jest @Developer Week 2018
Das Frontend richtig Testen – mit Jest @Developer Week 2018
 
How do I Write Testable Javascript so I can Test my CF API on Server and Client
How do I Write Testable Javascript so I can Test my CF API on Server and ClientHow do I Write Testable Javascript so I can Test my CF API on Server and Client
How do I Write Testable Javascript so I can Test my CF API on Server and Client
 
How Testing Changed My Life
How Testing Changed My LifeHow Testing Changed My Life
How Testing Changed My Life
 
Building JBoss AS 7 for Fedora
Building JBoss AS 7 for FedoraBuilding JBoss AS 7 for Fedora
Building JBoss AS 7 for Fedora
 
Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018
 
Selenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web ApplicationsSelenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web Applications
 
Testing Automaton - CFSummit 2016
Testing Automaton - CFSummit 2016Testing Automaton - CFSummit 2016
Testing Automaton - CFSummit 2016
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-to
 
Night Watch with QA
Night Watch with QANight Watch with QA
Night Watch with QA
 
Unit testing plugins: The 5 W's and an H
Unit testing plugins: The 5 W's and an HUnit testing plugins: The 5 W's and an H
Unit testing plugins: The 5 W's and an H
 
Getting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalGetting Started With Jenkins And Drupal
Getting Started With Jenkins And Drupal
 
Django Best Practices
Django Best PracticesDjango Best Practices
Django Best Practices
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija
 
Testing Django Applications
Testing Django ApplicationsTesting Django Applications
Testing Django Applications
 

En vedette

Testing Microservices Architectures
Testing Microservices ArchitecturesTesting Microservices Architectures
Testing Microservices ArchitecturesRenan Martins
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration TestingDavid Berliner
 
Django: инструкция по применению
Django: инструкция по применениюDjango: инструкция по применению
Django: инструкция по применениюIvan Kolodyazhny
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
TestArena Instrukcja obsługi dla wersji 3.0.929
TestArena Instrukcja obsługi dla wersji 3.0.929TestArena Instrukcja obsługi dla wersji 3.0.929
TestArena Instrukcja obsługi dla wersji 3.0.929Radoslaw Smilgin
 
Введение в Python и Django
Введение в Python и DjangoВведение в Python и Django
Введение в Python и DjangoTaras Lyapun
 
Achieving Balanced Agile Testing
Achieving Balanced Agile Testing Achieving Balanced Agile Testing
Achieving Balanced Agile Testing Cprime
 
Acceptance & Integration Testing With Behat (PHPNw2011)
Acceptance & Integration Testing With Behat (PHPNw2011)Acceptance & Integration Testing With Behat (PHPNw2011)
Acceptance & Integration Testing With Behat (PHPNw2011)benwaine
 
Testing & Integration (The Remix)
 Testing & Integration (The Remix) Testing & Integration (The Remix)
Testing & Integration (The Remix)Ines Sombra
 
Automating Django Functional Tests Using Selenium on Cloud
Automating Django Functional Tests Using Selenium on CloudAutomating Django Functional Tests Using Selenium on Cloud
Automating Django Functional Tests Using Selenium on CloudJonghyun Park
 
Jenkins & Selenium
Jenkins & SeleniumJenkins & Selenium
Jenkins & Seleniumadamcarmi
 
Exploratory Testing As A Quest
Exploratory Testing As A QuestExploratory Testing As A Quest
Exploratory Testing As A QuestChrishoneybee
 
Integration Testing Practice using Perl
Integration Testing Practice using PerlIntegration Testing Practice using Perl
Integration Testing Practice using PerlMasaki Nakagawa
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentMax Klymyshyn
 
What is this exploratory testing thing
What is this exploratory testing thingWhat is this exploratory testing thing
What is this exploratory testing thingtonybruce
 
Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
 Tips for Writing Better Charters for Exploratory Testing Sessions by Michael... Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...TEST Huddle
 
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServicePlay Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServiceJosh Padnick
 

En vedette (20)

Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
 
Testing Microservices Architectures
Testing Microservices ArchitecturesTesting Microservices Architectures
Testing Microservices Architectures
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration Testing
 
Django: инструкция по применению
Django: инструкция по применениюDjango: инструкция по применению
Django: инструкция по применению
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
Selenium
SeleniumSelenium
Selenium
 
TestArena Instrukcja obsługi dla wersji 3.0.929
TestArena Instrukcja obsługi dla wersji 3.0.929TestArena Instrukcja obsługi dla wersji 3.0.929
TestArena Instrukcja obsługi dla wersji 3.0.929
 
Введение в Python и Django
Введение в Python и DjangoВведение в Python и Django
Введение в Python и Django
 
Achieving Balanced Agile Testing
Achieving Balanced Agile Testing Achieving Balanced Agile Testing
Achieving Balanced Agile Testing
 
Acceptance & Integration Testing With Behat (PHPNw2011)
Acceptance & Integration Testing With Behat (PHPNw2011)Acceptance & Integration Testing With Behat (PHPNw2011)
Acceptance & Integration Testing With Behat (PHPNw2011)
 
Testing & Integration (The Remix)
 Testing & Integration (The Remix) Testing & Integration (The Remix)
Testing & Integration (The Remix)
 
Automating Django Functional Tests Using Selenium on Cloud
Automating Django Functional Tests Using Selenium on CloudAutomating Django Functional Tests Using Selenium on Cloud
Automating Django Functional Tests Using Selenium on Cloud
 
Jenkins & Selenium
Jenkins & SeleniumJenkins & Selenium
Jenkins & Selenium
 
Exploratory Testing As A Quest
Exploratory Testing As A QuestExploratory Testing As A Quest
Exploratory Testing As A Quest
 
Integration Testing Practice using Perl
Integration Testing Practice using PerlIntegration Testing Practice using Perl
Integration Testing Practice using Perl
 
A Taste of Exploratory Testing
A Taste of Exploratory TestingA Taste of Exploratory Testing
A Taste of Exploratory Testing
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
 
What is this exploratory testing thing
What is this exploratory testing thingWhat is this exploratory testing thing
What is this exploratory testing thing
 
Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
 Tips for Writing Better Charters for Exploratory Testing Sessions by Michael... Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
 
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServicePlay Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
 

Similaire à Continuous Integration Testing in Django

Stop Being Lazy and Test Your Software
Stop Being Lazy and Test Your SoftwareStop Being Lazy and Test Your Software
Stop Being Lazy and Test Your SoftwareLaura Frank Tacho
 
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet
 
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...NETWAYS
 
Continuous Testing and New Tools for Automation - Presentation from StarWest ...
Continuous Testing and New Tools for Automation - Presentation from StarWest ...Continuous Testing and New Tools for Automation - Presentation from StarWest ...
Continuous Testing and New Tools for Automation - Presentation from StarWest ...Sauce Labs
 
Effective Testing with Ansible and InSpec
Effective Testing with Ansible and InSpecEffective Testing with Ansible and InSpec
Effective Testing with Ansible and InSpecNathen Harvey
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox testsKevin Beeman
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile InfrastructuresAntons Kranga
 
Jest: Frontend Testing richtig gemacht @WebworkerNRW
Jest: Frontend Testing richtig gemacht @WebworkerNRWJest: Frontend Testing richtig gemacht @WebworkerNRW
Jest: Frontend Testing richtig gemacht @WebworkerNRWHolger Grosse-Plankermann
 
PVS-Studio in the Clouds: Travis CI
PVS-Studio in the Clouds: Travis CIPVS-Studio in the Clouds: Travis CI
PVS-Studio in the Clouds: Travis CIAndrey Karpov
 
Salt conf 2014 - Using SaltStack in high availability environments
Salt conf 2014 - Using SaltStack in high availability environmentsSalt conf 2014 - Using SaltStack in high availability environments
Salt conf 2014 - Using SaltStack in high availability environmentsBenjamin Cane
 
High Stakes Continuous Delivery in the Real World #OpenWest
High Stakes Continuous Delivery in the Real World #OpenWestHigh Stakes Continuous Delivery in the Real World #OpenWest
High Stakes Continuous Delivery in the Real World #OpenWestJoshua Warren
 
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!Docker, Inc.
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaAmazon Web Services
 
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpecTest-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpecMartin Etmajer
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at ScaleKris Buytaert
 
Django’s nasal passage
Django’s nasal passageDjango’s nasal passage
Django’s nasal passageErik Rose
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suiteericholscher
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 

Similaire à Continuous Integration Testing in Django (20)

Stop Being Lazy and Test Your Software
Stop Being Lazy and Test Your SoftwareStop Being Lazy and Test Your Software
Stop Being Lazy and Test Your Software
 
Azure from scratch part 4
Azure from scratch part 4Azure from scratch part 4
Azure from scratch part 4
 
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
 
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...
 
Continuous Testing and New Tools for Automation - Presentation from StarWest ...
Continuous Testing and New Tools for Automation - Presentation from StarWest ...Continuous Testing and New Tools for Automation - Presentation from StarWest ...
Continuous Testing and New Tools for Automation - Presentation from StarWest ...
 
Effective Testing with Ansible and InSpec
Effective Testing with Ansible and InSpecEffective Testing with Ansible and InSpec
Effective Testing with Ansible and InSpec
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox tests
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile Infrastructures
 
Jest: Frontend Testing richtig gemacht @WebworkerNRW
Jest: Frontend Testing richtig gemacht @WebworkerNRWJest: Frontend Testing richtig gemacht @WebworkerNRW
Jest: Frontend Testing richtig gemacht @WebworkerNRW
 
PVS-Studio in the Clouds: Travis CI
PVS-Studio in the Clouds: Travis CIPVS-Studio in the Clouds: Travis CI
PVS-Studio in the Clouds: Travis CI
 
Salt conf 2014 - Using SaltStack in high availability environments
Salt conf 2014 - Using SaltStack in high availability environmentsSalt conf 2014 - Using SaltStack in high availability environments
Salt conf 2014 - Using SaltStack in high availability environments
 
High Stakes Continuous Delivery in the Real World #OpenWest
High Stakes Continuous Delivery in the Real World #OpenWestHigh Stakes Continuous Delivery in the Real World #OpenWest
High Stakes Continuous Delivery in the Real World #OpenWest
 
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpecTest-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
 
Django’s nasal passage
Django’s nasal passageDjango’s nasal passage
Django’s nasal passage
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 

Dernier

Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 

Dernier (20)

Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 

Continuous Integration Testing in Django

  • 1. Continuous Integration Testing Django Boston Meetup 24 April 2014 Kevin Harvey @kevinharvey kevin@storyandstructure.com
  • 2. Who is this guy?
  • 3. Who is this guy? Fast Slow Unit Functional • Chief Technologist at Story+Structure • Djangonaut since 2007 (0.96)
  • 4. Here’s the best $24 I ever spent.
  • 5. What are we doing?
  • 6. Agenda • What is Continuous Integration? • Why use Continuous Integration? • CI in Practice: Travis • Coverage Thresholds with coverage.py • CI in Practice: Jenkins • Best Practices & Further Exploration
  • 8. Continuous Integration is like having a tireless robot that cleans up after you.
  • 9. What is CI? 1. Checkout out the latest copy of your code 2. Install the dependencies 3. Run the tests 4. Report the outcome Some server somewhere checks out your code, installs all your dependencies, runs your tests, and let’s you know if it worked or not.
  • 10. Testing in Django # jmad/tunes/tests/test_views.py from django.test import TestCase class TunesViewTestCase(TestCase): def test_index_view(self): response = self.client.get('/') self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, 'index.html') Here’s a quick primer on Django tests, for the uninitiated.
  • 11. Testing in Django # jmad/tunes/views/__init__.py from django.views.generic import TemplateView class IndexView(TemplateView): template_name = "index.html" # jmad/jmad/urls.py from django.conf.urls import patterns, url from tunes.views import IndexView urlpatterns = patterns('', url(r'^$', IndexView.as_view(), name='index'), ) Here’s the code to make that test pass (assuming there’s an index.html in a template directory somewhere).
  • 12. Testing in Django $ python manage.py test . --------------------------------------------------------------- ------- Ran 1 test in 0.029s OK Destroying test database for alias 'default'... $ And here’s how you’d run the test suite for the project.
  • 14. Why CI? Drink more beer. How can I drink more beer if the client calls me on Saturday night because the site is down?Bugs should show up fast, and you should fix them before your code is deployed.
  • 15. Why CI? Your test suite is only useful if you run it. You will forget to run your tests. Your collaborators will forget to run your tests. If you don’t run the tests, you won’t know your code is busted when it’s time to deploy.
  • 16. Why CI? I run tests with SQLite, d@&$#t. It’s fast. It’s there. If I want to build my project on my mom’s Mac Mini I don’t have to install homebrew. Plus, running a test suite creates a new database everytime. Let the m1.small sitting in Northern Virginia wait around for TestCase to create the PostgreSQL database. It doesn’t even like beer.
  • 17. Why CI? Your project is not getting deployed to a Macbook. Having said that, you need to run your tests in an environment like your production environment. Your project may have wacky dependencies that you installed a long time ago on your Macbook.
  • 18. Why CI? Know immediately if you can’t install a package
  • 19. Why CI? # requirements.txt ... PIL=1.1.7 # need to redeploy? The time to learn about a neat new package replacing an old clunky one is NOT when you’re trying to do an emergency redeployment.
  • 21. JMAD The Jazz Musicianship Archive and Database http://jmad.us code: https://github.com/kcharvey/jmad The Jazz Musicianship Archive and Database
  • 22. http://jmad.us I’m a bass player, I play some jazz.
  • 23. http://www.scu.edu/profiles/?p=5184 More importantly, I know Bill Stevens. He’s jazz faculty at Santa Clara University. He wrote a book called “Jazz Musicianship”. It’s a guide for jazz improvisation based on patterns that exists in many different jazz tunes.
  • 24. While we read headings like “Adding Callables to ModelAdmin Classes”...
  • 25. ... his headings are like “Engaging the Bebop Principle”.
  • 26. Screenshot JMAD is an archive of jazz music that’s been tagged with these different musical concepts. Basically you search by concept, instrument, difficulty, etc., and you get back solos with those parameters
  • 27. CI in Practice: Travis
  • 28. Travis • http://travis-ci.org • It’s where all these come from:
  • 29. Travis: Setup 1. Sign in with your Github account 2. Select the repos you want Travis to work on 3. Add a .travis.yml file to the root of the repo 4. Commit
  • 30.
  • 31. Travis: Basic .travis.yml language: python python:   - "3.3"   - "2.7" # command to install dependencies install:   - "pip install -r requirements/ci.txt" # command to run tests script: "python manage.py test"
  • 32. Travis: Egg .travis.yml language: python python:   - "3.3"   - "2.7" # command to install dependencies install:   - "pip install -r requirements/ci.txt"   - "pip install ." # command to run tests script: "cd testproject;python manage.py test myapp"
  • 33.
  • 34.
  • 35. Travis: Pros SaaS No server to set up, no apt-getting anything ever. It’s just there.
  • 36. Travis: Pros Free as in “free beer” (for public repos)
  • 37. Travis: Pros Config is maintained very obviously in Git Explicit, no implicit.
  • 38. Travis: Pros Cool little badgy thingy. Impress your hacker friends with your TDD prowess.
  • 40. Travis: Pros Just do it, even if you don’t have any tests. It will still check your requirements and build your app.
  • 41. Travis: Cons Hope you’re using GitHub. Maybe there’s a way to use non-GitHub repos, but I’ll be damned if it’s documented anywhere.
  • 42. Travis: Cons You’re stuck with their architecture. For instance, when I was putting this app together they didn’t have Python 3.4 yet.
  • 43. coverage.py coverage.py is a utility created by Boston’s own Ned Batchelder.
  • 44. coverage.py How much of my code is not covered by tests? It answers this question.
  • 45. coverage.py $ coverage run --source='.' manage.py test --settings=jmad.settings.base Creating test database for alias 'default'... ...E ... ---------------------------------------------------------- Ran 4 tests in 3.353s FAILED (errors=1) Destroying test database for alias 'default'... Run your tests with coverage...
  • 46. coverage.py $ coverage report --omit=*test*,*settings* Name Stmts Miss Cover ------------------------------------------------- jmad/__init__ 0 0 100% jmad/urls 6 0 100% jmad/wsgi 4 4 0% manage 6 0 100% people/__init__ 0 0 100% people/admin 1 0 100% people/models 1 0 100% people/views/__init__ 4 0 100% tunes/__init__ 0 0 100% tunes/admin 1 0 100% tunes/models 1 0 100% tunes/templatetags/__init__ 0 0 100% tunes/templatetags/add_css 5 0 100% tunes/urls 3 0 100% tunes/views/__init__ 5 0 100% ------------------------------------------------- TOTAL 37 4 89% ... then generate a report to see what’s not being tested.
  • 47. coverage.py $ coverage report --omit=*test*,*settings* So let’s take a closer look at the report command
  • 48. coverage.py $ coverage report --omit=*test*,*settings* --omit tells coverage to not report on a few things. Since we have multiple settings files, and we don’t test our tests, we omit them both.
  • 49. coverage.py $ coverage report --omit=*test*,*settings* --fail-under=85 --fail-under take an integer, and compares that to the total percentage of coverage, and makes this command return a 2 (anything but 0 is failure).
  • 50. Travis and coverage.py language: python python:   - "3.3"   - "2.7" # command to install dependencies install:   - "pip install -r requirements/ci.txt" # command to run tests script:   - "coverage run source=’.’ manage.py test"   - "coverage report --omit=*settings*,*test* --fail-under=85" # 85% coverage minimum Swap out your script with these two lines: one to run the tests with coverage, and the other to run a report that can fail. Now if we’re at 85% coverage and someone pushes new code without test coverage, we’ll drop below 85% and get a failed build.
  • 51. coverage.py “Code without tests is broken by design.” -- Jacob Kaplan-Moss This is a good thing.
  • 52. CI in Practice: Jenkins
  • 53. Jenkins • http://jenkins-ci.org/ • Django’s Jenkins: http://ci.djangoproject.com/
  • 54. Installing Jenkins $ wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war $ java -jar jenkins.war http://localhost:8080 Just get the .war file, run it, and hit port 8080 on your machine. You could deploy it behind Tomcat or the like.
  • 55. Or grab a VM Installing Jenkins I used a TurnKey Linux prebuilt VM.
  • 56. Configuring Jenkins You’ll need some plugins: - Jenkins Violations Plugin - Jenkins Git Plugin - Jenkins Cobertura Plugin Install a few plugins.
  • 57. Configuring Jenkins Got Selenium tests? So, if you’re like me, you’ve got Jenkins on a headless version of Linux. We’ll have to do some magic to get our Selenium tests to run.
  • 58. Configuring Jenkins # on the Jenkins box $ sudo apt-get install iceweasel # install firefox $ sudo apt-get install xvfb # frame buffer emulator Install firefox (the package is called iceweasel for some reason).
  • 59. Configuring Jenkins # /etc/init.d/xvfb #!/bin/bash if [ -z "$1" ]; then echo "`basename $0` {start|stop}" exit fi case "$1" in start) /usr/bin/Xvfb :99 -ac -screen 0 1024x768x8 & ;; stop) killall Xvfb ;; esac Configure xvfb to run when the server starts
  • 60. Configuring Jenkins $ sudo chmod 755 /etc/init.d/xvfb $ sudo shutdown -r now make that file executable, and restart the server
  • 61. Configuring Jenkins $ pip install django-jenkins INSTALLED_APPS = ( ... 'django_jenkins', ) ... JENKINS_TASKS = ( 'django_jenkins.tasks.run_pylint', 'django_jenkins.tasks.with_coverage', 'django_jenkins.tasks.run_pep8', # there are more of these ) $ python manage.py jenkins # Jenkins will run this command django-jenkins is a plugin that runs out tests and outputs the files Jenkins needs to show our build stats. pip install and add some stuff to your settings.py
  • 62. Configuring Jenkins 1. Configure a new test (name, description) 2. Give it your repo URL 3. Tell it how often to build 4. Tell it the commands to run 5. Configure where to save the reports 6. Click “Build Now” Check out the tutorials in the “Resources” section of this slide deck for more on configuring your repo. It’ll take about 15 minutes the first time.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67. Configuring Jenkins #!/bin/bash virtualenv -p python3.4 env env/bin/pip install -r requirements/ci.txt export SECRET_KEY='dnqsj22jdv9wjsldfub9' export DISPLAY=:99 env/bin/python manage.py jenkins --settings=jmad.settings.ci here’s what that command really should be
  • 68.
  • 69.
  • 70. So what did we get? Jenkins I used a TurnKey Linux prebuilt VM.
  • 71. Here’s a list of all the projects Jenkins knows to build
  • 72. The project page for JMAD. Note the historic list of builds at the bottom left.
  • 73. An individual build. That’s a list of commit messages under ‘changes’. And the link to the console output.
  • 77. Free as in beer and speech Jenkins: Pros Open. Extensible. Good for the spirit.
  • 78. Plugins install like Wordpress Jenkins: Pros And by that I mean, it’s almost *too* easy. Just search for them from your installation and click “install”.
  • 79. Distributed builds Jenkins: Pros I haven’t done any work with this at all, but Jenkins supports a ‘master/slave’ mode, allowing a single Jenkins instance to control many others. This would allow you to test a project on a bunch of different platforms simultaneously. You can see how that would benefit the Django project itself, or other large Python packages.
  • 80. It’s your architecture. Jenkins: Pros Need to run Python compiled with some magical incantation? Need a special server utility installed? Jenkins runs on an OS you control, so do what you gotta do.
  • 81. It’s nobody else’s architecture. Jenkins: Cons That, of course, leads to our first con.
  • 82. To paraphrase Uncle Ben, “With great power can come a whole lot of bullshit.”
  • 83. 15 apt-get update 16 sudo apt-get install build-essential 17 apt-get install build-essential 18 apt-get install libsqlite3-dev 19 apt-get install sqlite3 20 apt-get install bzip2 libbz2-dev 21 ls 22 ls .. 23 mkdir src 24 cd src/ 25 wget http://www.python.org/ftp/python/3.4.0/Python-3.4.0.tar.xz 26 tar xJf ./Python-3.4.0.tar.xz 27 cd Python-3.4.0/ 28 ./configure --prefix=/opt/python3.4 29 make && make install 30 python3.4 31 ln -s /opt/python3.4/bin/python3.4 ~/bin/python3.4 32 ls ~ 33 mkdir bin 34 ln -s /opt/python3.4/bin/python3.4 ~/bin/python3.4 35 ls Jenkins: Cons Here’s the first twenty lines of me fumbling through installing Python 3.4, pip, and virtualenv
  • 84. 36 ls bin 37 rm -rf bin 38 mkdir ~/bin 39 ln -s /opt/python3.4/bin/python3.4 ~/bin/python3.4 40 python2.4 41 python3.4 42 virtualenv 43 ls /opt/python3.4/bin/ 44 cd 45 ls 46 ls bin/ 47 bin/python3.4 48 python3.4 49 ls /usr/bin/ 50 ln -s /opt/python3.4/bin/python3.4 /usr/bin/python3.4 51 python3.4 52 rm -rf bin/ 53 wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py 54 python3.4 get-pip.py 55 apt-get install zlib 56 apt-get install zlib1g Jenkins: Cons ... and here’s the next twenty lines...
  • 85. 57 python3.4 get-pip.py 58 apt-get install zlib1g 59 apt-get install zlib-dev 60 apt-get install zlibc 61 python3.4 get-pip.py 62 apt-get install zlib1g-dev 63 python3.4 get-pip.py 64 apt-get install zlib-bin 65 python3.4 get-pip. 66 python3.4 get-pip.py 67 cd src/ 68 ls 69 cd Python-3.4.0/ 70 history 71 ./configure --prefix=/opt/python3.4 72 make && make install 73 apt-get install libssl-dev openssl 74 make && make install 75 which pip 76 cd ~ 77 ln -s /opt/python3.4/bin/pip3.4 /usr/bin/pip3.4 78 pip3.4 install virtualenv Jenkins: Cons ... and the next. So you’ll need some sysadmin chops.
  • 86. And I still need to set up a mail server. Jenkins: Cons
  • 87. Git is a plugin Jenkins: Cons Again, it’s not hard to install plugins, but other tools are Git-centric, so it’s worth mentioning.
  • 89. Best Practices Use multiple settings.py and requirements.txt files
  • 90. Best Practices # jmad/settings/ci.py INSTALLED_APPS = ( ... ‘django_jenkins’ ) ... JENKINS_TASKS = ( ‘django_jenkins.tasks.run_pylint’, ‘django_jenkins.tasks.with_coverage’, ‘django_jenkins.tasks.run_pep8’ ) Keep this stuff out of your production app (and your dev environment, for that matter).
  • 91. Best Practices # requirements/ci.txt ... coverage==3.7.1 # duped in dev.txt django_jenkins==0.15.0 pep8==1.5.6 (and your dev environment, for that matter).
  • 92. Best Practices Rebuild your env in Jenkins
  • 93. Best Practices #!/bin/bash rm -rf env virtualenv -p python2.7 env env/bin/pip install -r requirements/ci.txt export SECRET_KEY='dnqsj22jdv9wjsldfub9' env/bin/python manage.py jenkins --settings=jmad.settings.ci Toss the old env before you recreate it.
  • 95. “Just-in-time Jenkins” a.k.a. “The AWS Miser” a.k.a “Big Testing” Further Exploration You could imagine a scenario in which, using one of the many DevOps tools available, you spin up and AWS instance, install and configure Jenkins, set up your tests, report and then tear down the box. This would be particularly useful if you wanted to test on a multidtude of platforms but didn’t want to pay to keep them all up all the time.
  • 96. Alternatives to Travis • https://circleci.com/ • https://drone.io/ Further Exploration Travis is not the only SaaS CI game in town. Drone.io works with BitBucket.
  • 97. tox Further Exploration It’s a tool to test your project in multiple version of Python in one go, and can act as a front end to a CI server. Has anyone here used tox?
  • 98. django-jenkins Tasks There are a number of tasks available in django-jenkins that I haven’t showed you yet.
  • 99. django_jenkins.tasks.run_jshint django_jenkins.tasks.run_csslint django-jenkins Tasks Runs jshint or csshint tools of your static directory, and produces reports that work in Jenkins. You’ll need to install jshint/csslint on the box that Jenkins is running on.
  • 100. django_jenkins.tasks.run_pyflakes django-jenkins Tasks If you’re using Pyflakes, django-jenkins has you covered. Add Pyflakes to you requirements/ci.txt file.
  • 101. django_jenkins.tasks.run_flake8 django-jenkins Tasks Same deal with flake8. You’re beginning to see how jenkins is trying to fit in with whatever testing tools you’re already using.
  • 102. django_jenkins.tasks.run_sloccount django-jenkins Tasks SLOCCount is a utility for counting lines of code. The developer missed a big opportunity to call his project SLOCConut, IMHO. Install SLOCCount on the server to get this one going.
  • 103. django_jenkins.tasks.run_sloccount django-jenkins Tasks SLOCCount is a utility for counting lines of code. The developer missed a big opportunity to call his project SLOCConut, IMHO. Install SLOCCount on the server to get this one going.
  • 104. django_jenkins.tasks.run_graphmodels django-jenkins Tasks You can also let Jenkins graph your models for you.
  • 105. You need django-extensions and pygraphviz in your CI requirements for this one to work.
  • 106. django_jenkins.tasks.with_local_celery django-jenkins Tasks Django Jenkins also provides a test runner to run your tests with Celery, if you’re in to that sort of thing.
  • 108. Questions? @kevinharvey github.com/kcharvey Show of hands: if your boss/client/conscience dictated that you had to implement CI tomorrow, would you use one of the hosted/SaaS tools or go with Jenkins?
  • 109. Resources Setting up Jenkins for Selenium tests • http://www.labelmedia.co.uk/blog/setting-up- selenium-server-on-a-headless-jenkins-ci-build- machine.html • http://www.installationpage.com/selenium/how- to-run-selenium-headless-firefox-in-ubuntu/ • Just Google it