SlideShare a Scribd company logo
1 of 32
Download to read offline
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

Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Justin Ison
 
Create an architecture for web test automation
Create an architecture for web test automationCreate an architecture for web test automation
Create an architecture for web test automationElias Nogueira
 
Cypress e2e automation testing - day1 intor by: Hassan Hameed
Cypress e2e automation testing -  day1 intor by: Hassan HameedCypress e2e automation testing -  day1 intor by: Hassan Hameed
Cypress e2e automation testing - day1 intor by: Hassan HameedHassan Muhammad
 
Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011Adam Christian
 
Selenium Israel Meetup
Selenium Israel MeetupSelenium Israel Meetup
Selenium Israel MeetupJustin Ison
 
Octopus Deploy @Erie Day of Code
Octopus Deploy @Erie Day of CodeOctopus Deploy @Erie Day of Code
Octopus Deploy @Erie Day of CodeCassey Lottman
 
Cypress first impressions
Cypress first impressionsCypress first impressions
Cypress first impressionsHans Emmel
 
Основы нагрузочного тестирования с инструментом Jmeter
Основы нагрузочного тестирования с инструментом JmeterОсновы нагрузочного тестирования с инструментом Jmeter
Основы нагрузочного тестирования с инструментом JmeterКомпьютерная школа Hillel
 
Asynchronous Programming in C# - Part 1
Asynchronous Programming in C# - Part 1Asynchronous Programming in C# - Part 1
Asynchronous Programming in C# - Part 1Mindfire Solutions
 
DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016Justin Ison
 
Introducing Ghost Inspector
Introducing Ghost InspectorIntroducing Ghost Inspector
Introducing Ghost InspectorNeil Mansilla
 
Deployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityDeployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityTomas Jansson
 
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)Domas Lasauskas
 
Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?Shivam Bharadwaj
 
Perl Continous Integration
Perl Continous IntegrationPerl Continous Integration
Perl Continous IntegrationMichael Peters
 
Apache JMeter Introduction
Apache JMeter IntroductionApache JMeter Introduction
Apache JMeter IntroductionSøren Lund
 
Belfast Selenium Meetup
Belfast Selenium MeetupBelfast Selenium Meetup
Belfast Selenium MeetupJustin Ison
 
Django strategy-test
Django strategy-testDjango strategy-test
Django strategy-testRoyce Haynes
 
Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014adriantwright
 

What's hot (20)

Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014
 
Create an architecture for web test automation
Create an architecture for web test automationCreate an architecture for web test automation
Create an architecture for web test automation
 
Cypress e2e automation testing - day1 intor by: Hassan Hameed
Cypress e2e automation testing -  day1 intor by: Hassan HameedCypress e2e automation testing -  day1 intor by: Hassan Hameed
Cypress e2e automation testing - day1 intor by: Hassan Hameed
 
Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011
 
Selenium Israel Meetup
Selenium Israel MeetupSelenium Israel Meetup
Selenium Israel Meetup
 
Octopus Deploy @Erie Day of Code
Octopus Deploy @Erie Day of CodeOctopus Deploy @Erie Day of Code
Octopus Deploy @Erie Day of Code
 
Cypress first impressions
Cypress first impressionsCypress first impressions
Cypress first impressions
 
Основы нагрузочного тестирования с инструментом Jmeter
Основы нагрузочного тестирования с инструментом JmeterОсновы нагрузочного тестирования с инструментом Jmeter
Основы нагрузочного тестирования с инструментом Jmeter
 
Asynchronous Programming in C# - Part 1
Asynchronous Programming in C# - Part 1Asynchronous Programming in C# - Part 1
Asynchronous Programming in C# - Part 1
 
DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016
 
Introducing Ghost Inspector
Introducing Ghost InspectorIntroducing Ghost Inspector
Introducing Ghost Inspector
 
Deployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityDeployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCity
 
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
 
Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?
 
Perl Continous Integration
Perl Continous IntegrationPerl Continous Integration
Perl Continous Integration
 
Apache JMeter Introduction
Apache JMeter IntroductionApache JMeter Introduction
Apache JMeter Introduction
 
Belfast Selenium Meetup
Belfast Selenium MeetupBelfast Selenium Meetup
Belfast Selenium Meetup
 
Django strategy-test
Django strategy-testDjango strategy-test
Django strategy-test
 
Graphql usage
Graphql usageGraphql usage
Graphql usage
 
Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014
 

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

Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Frameworkwebhostingguy
 
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios
 
Into The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsInto The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsOrtus Solutions, Corp
 
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017Xavi Hidalgo
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox testsKevin Beeman
 
Test Presentation
Test PresentationTest Presentation
Test Presentationsetitesuk
 
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Igalia
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development CodeOps Technologies LLP
 
Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy codeLars Thorup
 
Test Driven Development with Sql Server
Test Driven Development with Sql ServerTest Driven Development with Sql Server
Test Driven Development with Sql ServerDavid P. Moore
 
Unit testing php-unit - phing - selenium_v2
Unit testing   php-unit - phing - selenium_v2Unit testing   php-unit - phing - selenium_v2
Unit testing php-unit - phing - selenium_v2Tricode (part of Dept)
 
Testing Spark and Scala
Testing Spark and ScalaTesting Spark and Scala
Testing Spark and Scaladatamantra
 
POUG2019 - Test your PL/SQL - your database will love you
POUG2019 - Test your PL/SQL - your database will love youPOUG2019 - Test your PL/SQL - your database will love you
POUG2019 - Test your PL/SQL - your database will love youJacek Gebal
 
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Борис Зора
 
Test automation principles, terminologies and implementations
Test automation principles, terminologies and implementationsTest automation principles, terminologies and implementations
Test automation principles, terminologies and implementationsSteven Li
 
Bgoug 2019.11 test your pl sql - not your patience
Bgoug 2019.11   test your pl sql - not your patienceBgoug 2019.11   test your pl sql - not your patience
Bgoug 2019.11 test your pl sql - not your patienceJacek Gebal
 
Break through e2e-testing
Break through e2e-testingBreak through e2e-testing
Break through e2e-testingtameemahmed5
 

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

Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Framework
 
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
 
Into The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsInto The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applications
 
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox tests
 
Test Presentation
Test PresentationTest Presentation
Test Presentation
 
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy code
 
Test Driven Development with Sql Server
Test Driven Development with Sql ServerTest Driven Development with Sql Server
Test Driven Development with Sql Server
 
Unit testing php-unit - phing - selenium_v2
Unit testing   php-unit - phing - selenium_v2Unit testing   php-unit - phing - selenium_v2
Unit testing php-unit - phing - selenium_v2
 
Testing Spark and Scala
Testing Spark and ScalaTesting Spark and Scala
Testing Spark and Scala
 
POUG2019 - Test your PL/SQL - your database will love you
POUG2019 - Test your PL/SQL - your database will love youPOUG2019 - Test your PL/SQL - your database will love you
POUG2019 - Test your PL/SQL - your database will love you
 
Tdd
TddTdd
Tdd
 
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
 
Test automation principles, terminologies and implementations
Test automation principles, terminologies and implementationsTest automation principles, terminologies and implementations
Test automation principles, terminologies and implementations
 
Bgoug 2019.11 test your pl sql - not your patience
Bgoug 2019.11   test your pl sql - not your patienceBgoug 2019.11   test your pl sql - not your patience
Bgoug 2019.11 test your pl sql - not your patience
 
Break through e2e-testing
Break through e2e-testingBreak through e2e-testing
Break through e2e-testing
 
Cypress Testing.pptx
Cypress Testing.pptxCypress Testing.pptx
Cypress Testing.pptx
 

More from Alex Balhatchet

Geocoding the World in Perl YAPC::EU 2014
Geocoding the World in Perl YAPC::EU 2014Geocoding the World in Perl YAPC::EU 2014
Geocoding the World in Perl YAPC::EU 2014Alex Balhatchet
 
Test Kit 2.0 YAPC::EU 2014 Lightning Talk
Test Kit 2.0 YAPC::EU 2014 Lightning TalkTest Kit 2.0 YAPC::EU 2014 Lightning Talk
Test Kit 2.0 YAPC::EU 2014 Lightning TalkAlex Balhatchet
 
Nestoria Dev Blog YAPC::EU 2014 Lightning Talk
Nestoria Dev Blog YAPC::EU 2014 Lightning TalkNestoria Dev Blog YAPC::EU 2014 Lightning Talk
Nestoria Dev Blog YAPC::EU 2014 Lightning TalkAlex Balhatchet
 
Test::Kit 2.0 (London.pm Technical Meeting July 2014)
Test::Kit 2.0 (London.pm Technical Meeting July 2014)Test::Kit 2.0 (London.pm Technical Meeting July 2014)
Test::Kit 2.0 (London.pm Technical Meeting July 2014)Alex Balhatchet
 
App::highlight - a simple grep-like highlighter app
App::highlight - a simple grep-like highlighter appApp::highlight - a simple grep-like highlighter app
App::highlight - a simple grep-like highlighter appAlex Balhatchet
 
Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)
Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)
Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)Alex Balhatchet
 
Introduction to writing readable and maintainable Perl
Introduction to writing readable and maintainable PerlIntroduction to writing readable and maintainable Perl
Introduction to writing readable and maintainable PerlAlex Balhatchet
 

More from Alex Balhatchet (10)

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

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