SlideShare a Scribd company logo
Continuous
Deployment in Perl
Presentation by Alex Balhatchet (KAORU)
Intro
What is continuous deployment?


Commit Changes




                 Deploy Changes
                                  As quickly as
                                  possible! :-)

 Test Changes
Committing Changes

● Use your favourite VCS

● Push the changes somewhere centralized
  (staging/testing environment)

● This should kick off a "build and test" cycle if
  one is not currently running
Testing Changes

Perl is absolutely fantastic for testing.

● TAP

● TAP::Harness / App::Prove

● Test::Builder / Test::More
Deploying Changes

● Pick your favourite deployment method

● Make it as fast as possible

● Make it as easy as possible
Challenges

● Fast tests

● Reliable tests

● Fast deployment
Challenges

● Fast tests
                    Focus of this talk
● Reliable tests

● Fast deployment
Perl Testing
TAP::Harness
and App::Prove
TAP::Harness and App::Prove

/usr/bin/prove

     uses App::Prove

           uses TAP::Harness
App::Prove features - basics

● Run lots of tests with one command

● Hide non-failure output

● Run tests in parallel

● Show timing information
App::Prove features - basics

alex@karin$ prove -l -r -j 16 t/
t/00-load.t .......... ok
t/01-backup.t ........ ok
t/02-delete_files.t .. ok
All tests successful.
Files=3, Tests=51, 1 wallclock secs ( 0.06 usr
0.01 sys + 0.78 cusr 0.20 csys = 1.05 CPU)
Result: PASS
App::Prove features - advanced

● Load plugins from App::Prove::Plugin::*

● Save the TAP results to a .tgz archive

● Save state between runs and use that state
  to change the order for future runs
App::Prove features - advanced
alex@karin$ prove -l -r --state=hot,all,save t/
No saved state, selection will be empty
t/00-load.t .. ok
t/01-good.t .. ok
t/02-bad.t ... 1/1



alex@karin$ prove -l -r --state=hot,all,save t/
t/02-bad.t ... 1/1   <===== Runs first!
t/00-load.t .. ok
t/01-good.t .. ok
App::Prove features - advanced

Other "state" options:

● slow - very useful with -j N

● fresh - only run the tests you need to

● last - same as last run, even with --shuffle
Test::Aggregate
Test::Aggregate

● Combine multiple .t files into a single file

● Avoids compilation overhead

● Therefore speeds up your tests!
Test::Aggregate::Nested

● Alpha code

● Uses the fairly recently added syntax for
  subtests in TAP

● Works really well for us!
Test::Aggregate caveats

● Breaks BEGIN and END blocks

  (use Scope::Guard instead!)

● exit() is also a bad idea!

● Be aware of Test modules which use these

  (Test::NoWarnings is the most common!)
Parallelisation of Aggregated Tests
Currently closed source - sorry! The logic is:

   i. Split up tests into N groups

  ii. Copy .t files into temporary directory

  iii. Write temporary .t file that uses Test::
       Aggregate::Nested

 iv. Run those tests with prove -j N
TAP::Harness
::Archive
TAP::Harness::Archive

● "isa" TAP::Harness

● Stores the TAP output in a tar archive

● Gives you full TAP even when running in
  parallel

● Allows you to run your tests once and then
  format the results in multiple ways
How we format our TAP

● Process the output from our parallelised
  aggregated test runs

● Match up the failures with the .t files

● Write a summary in Markdown format that's
  later converted to HTML and emailed to us
How you might format your TAP

● TAP::Formatter::JUnit (eg. for Jenkins)

● TAP::Formatter::TeamCity

● TAP::Formatter::HTML
TAP::Formatter::HTML example
TAP::Formatter::HTML example
Putting it all
together
Continuous Deployment at Lokku

    svn commit                         On test success new code is
                                          automatically pushed

                                       Deployment is one command
                                             and very quick


   Perl daemon notices commit

Parallelised and aggregated test run
            starts running

Nicely formatted results are emailed
        on success or failure
What's next?
What's next?

● Test::WWW::Selenium::More

● Faster tests - more unit tests, fewer
  integration tests

● Parallelised deployment
Thanks!
Any questions?

More Related Content

What's hot (20)

PPTX
Helpful Automation Techniques - Selenium Camp 2014
Justin Ison
 
PDF
Create an architecture for web test automation
Elias Nogueira
 
PDF
Cypress e2e automation testing - day1 intor by: Hassan Hameed
Hassan Muhammad
 
KEY
Jellyfish, JSCONF 2011
Adam Christian
 
PDF
Selenium Israel Meetup
Justin Ison
 
PPTX
Octopus Deploy @Erie Day of Code
Cassey Lottman
 
PPTX
Cypress first impressions
Hans Emmel
 
PPTX
Основы нагрузочного тестирования с инструментом Jmeter
Компьютерная школа Hillel
 
PPT
Asynchronous Programming in C# - Part 1
Mindfire Solutions
 
PDF
DCAST Meetup - Washington, DC Feb 2016
Justin Ison
 
PDF
Introducing Ghost Inspector
Neil Mansilla
 
PPTX
Deployment taken seriously with Octopus Deploy and TeamCity
Tomas Jansson
 
PDF
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Domas Lasauskas
 
PPTX
Why you should switch to Cypress for modern web testing?
Shivam Bharadwaj
 
PDF
Perl Continous Integration
Michael Peters
 
ODP
Apache JMeter Introduction
Søren Lund
 
PDF
Belfast Selenium Meetup
Justin Ison
 
PPTX
Django strategy-test
Royce Haynes
 
PDF
Graphql usage
Valentin Buryakov
 
PDF
Octopus Deploy Tech Fest 2014
adriantwright
 
Helpful Automation Techniques - Selenium Camp 2014
Justin Ison
 
Create an architecture for web test automation
Elias Nogueira
 
Cypress e2e automation testing - day1 intor by: Hassan Hameed
Hassan Muhammad
 
Jellyfish, JSCONF 2011
Adam Christian
 
Selenium Israel Meetup
Justin Ison
 
Octopus Deploy @Erie Day of Code
Cassey Lottman
 
Cypress first impressions
Hans Emmel
 
Основы нагрузочного тестирования с инструментом Jmeter
Компьютерная школа Hillel
 
Asynchronous Programming in C# - Part 1
Mindfire Solutions
 
DCAST Meetup - Washington, DC Feb 2016
Justin Ison
 
Introducing Ghost Inspector
Neil Mansilla
 
Deployment taken seriously with Octopus Deploy and TeamCity
Tomas Jansson
 
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Domas Lasauskas
 
Why you should switch to Cypress for modern web testing?
Shivam Bharadwaj
 
Perl Continous Integration
Michael Peters
 
Apache JMeter Introduction
Søren Lund
 
Belfast Selenium Meetup
Justin Ison
 
Django strategy-test
Royce Haynes
 
Graphql usage
Valentin Buryakov
 
Octopus Deploy Tech Fest 2014
adriantwright
 

Similar to Continuous testing and deployment in Perl (London.pm Technical Meeting October 2012) (20)

PDF
Test-Tutorial
tutorialsruby
 
PDF
Test-Tutorial
tutorialsruby
 
PDF
Hiveminder - Everything but the Secret Sauce
Jesse Vincent
 
ODP
Smolder Introduction
Michael Peters
 
ODP
Software Testing
Lambert Lum
 
PPTX
Anatomy of a Build Pipeline
Samuel Brown
 
PDF
Running and Developing Tests with the Apache::Test Framework
webhostingguy
 
PDF
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Jesse Vincent
 
PDF
O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...
Rodolfo Carvalho
 
ODP
LPW 2007 - Perl Plumbing
lokku
 
PDF
Test tutorial
msksaba
 
PDF
Escaping Automated Test Hell - One Year Later
Wojciech Seliga
 
PPTX
Continuous Test Automation via CI (CodeMash 2012) - Automating the Agile way
Leonard Fingerman
 
PDF
The Journey Towards Continuous Integration
Sebastian Marek
 
PDF
Enabling Agile Testing Through Continuous Integration Agile2009
sstolberg
 
PDF
Getting testy with Perl
Workhorse Computing
 
PDF
IntroTestMore
tutorialsruby
 
PDF
IntroTestMore
tutorialsruby
 
PDF
Keeping objects healthy with Object::Exercise.
Workhorse Computing
 
PDF
YAPCEurope2014-myfinder
Tatsuro Hisamori
 
Test-Tutorial
tutorialsruby
 
Test-Tutorial
tutorialsruby
 
Hiveminder - Everything but the Secret Sauce
Jesse Vincent
 
Smolder Introduction
Michael Peters
 
Software Testing
Lambert Lum
 
Anatomy of a Build Pipeline
Samuel Brown
 
Running and Developing Tests with the Apache::Test Framework
webhostingguy
 
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Jesse Vincent
 
O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...
Rodolfo Carvalho
 
LPW 2007 - Perl Plumbing
lokku
 
Test tutorial
msksaba
 
Escaping Automated Test Hell - One Year Later
Wojciech Seliga
 
Continuous Test Automation via CI (CodeMash 2012) - Automating the Agile way
Leonard Fingerman
 
The Journey Towards Continuous Integration
Sebastian Marek
 
Enabling Agile Testing Through Continuous Integration Agile2009
sstolberg
 
Getting testy with Perl
Workhorse Computing
 
IntroTestMore
tutorialsruby
 
IntroTestMore
tutorialsruby
 
Keeping objects healthy with Object::Exercise.
Workhorse Computing
 
YAPCEurope2014-myfinder
Tatsuro Hisamori
 
Ad

More from Alex Balhatchet (10)

PDF
Geocoding the World in Perl YAPC::EU 2014
Alex Balhatchet
 
PDF
Test Kit 2.0 YAPC::EU 2014 Lightning Talk
Alex Balhatchet
 
PDF
Nestoria Dev Blog YAPC::EU 2014 Lightning Talk
Alex Balhatchet
 
PDF
Test::Kit 2.0 (London.pm Technical Meeting July 2014)
Alex Balhatchet
 
PDF
Perl 101
Alex Balhatchet
 
PDF
App::highlight - a simple grep-like highlighter app
Alex Balhatchet
 
PDF
File::CleanupTask
Alex Balhatchet
 
PDF
Authoring CPAN modules
Alex Balhatchet
 
PDF
Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)
Alex Balhatchet
 
PDF
Introduction to writing readable and maintainable Perl
Alex Balhatchet
 
Geocoding the World in Perl YAPC::EU 2014
Alex Balhatchet
 
Test Kit 2.0 YAPC::EU 2014 Lightning Talk
Alex Balhatchet
 
Nestoria Dev Blog YAPC::EU 2014 Lightning Talk
Alex Balhatchet
 
Test::Kit 2.0 (London.pm Technical Meeting July 2014)
Alex Balhatchet
 
Perl 101
Alex Balhatchet
 
App::highlight - a simple grep-like highlighter app
Alex Balhatchet
 
File::CleanupTask
Alex Balhatchet
 
Authoring CPAN modules
Alex Balhatchet
 
Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)
Alex Balhatchet
 
Introduction to writing readable and maintainable Perl
Alex Balhatchet
 
Ad

Continuous testing and deployment in Perl (London.pm Technical Meeting October 2012)