SlideShare a Scribd company logo
Automated Testing
About Promet

Mission Statement: “Promet Solutions specializes in
developing innovative, complex web applications with open
source technology.”

30+ solutions architects      10 year in business
                                 th

worldwide
                              32 open source contributions
  • Offices in the US
     • Chicago                10+ mobile apps in the past 12 months
     • San Jose
ABOUT JOHNNIE:


                 •   Presenter
                     •   Johnnie Fox
                     •   @johnniefox
                 •   Promet Source
                     •   Director of Development
                     •   Scrum Master
                     •   Project Manager
                     •   Recovering Developer
                     •   @prometsource
ABOUT CHRIS


                          •   Presenter
Insert picture of Chris
                              •   Chris Calip

                          •   Promet Source
                              •   Application Developer
                              •   @prometsource
HISTORY OF DRUPAL TESTING

 Drupal Testing:
 D6 core – Simpletest
 Application specific testing
 - Manual Tests
 - Written test cases – Word documents
 - The spreadsheet of pain. (Checklist)

Challenges -
     Testing different browsers
     Reproducible results
     Providing a record
     Doesn’t test integration with 3rd party API (backend functionality)
CONTINUOUS INTEGRATION:

Continuous Integration (CI) implements continuous processes of applying
quality control — small pieces of effort, applied frequently. Continuous
integration aims to improve the quality of software, and to reduce the time
taken to deliver it, by replacing the traditional practice of applying quality control
after completing all development.


Continuous Integration emerged in the Extreme Programming (XP) community,
and XP advocates Martin Fowler and Kent Beck first wrote about continuous
integration circa 1999.




                                                         Continuous integration - Wikipedia, the free
                                                         encyclopedia : taken from -
                                                         http://en.wikipedia.org/wiki/Continuous_integrationhttp
                                                         ://creativecommons.org/licenses/by-sa/3.0/
HACKATHON TEAM :

    Five. Striving as one. Driven by a passion for continuous automated quality control.




   Ruoran Wang
   Scott Massey
   Chris Calip
   Johnnie Fox
   Michelle Krejci
HACKATHON OBJECTIVE:

Develop, deploy, demonstrate, and identify challenges of
making using ci infrastructure to implement acceptance
tests (unit tests, selenium) on one existing site.
TECHNICAL DETAILS

                              code metrics

                            phpqatools.org

                            user acceptance

 provisions servers with
 testing components




admin gui to trigger test
suites, or view reports
Necessary components


• For necessary components and installation instructions,
  go to:
• Phing Drupal Template
• http://reload.github.com/phing-drupal-template/
• Jenkins Drupal Template
• http://reload.github.com/jenkins-drupal-template
• Phing Drupal Template with User Acceptance Test
• http://github.com/promet/phing-drupal-template
• In addition for phing-drupal-template with user acceptance
  test, you need to install additional pear libraries
  • For more instructions, http://phpqatools.org/
Installing Infrastructure

Initial assumption: your server has several initial software
already

1. Go to https://github.com/promet/phing-drupal-template
2. Three files that you need to use to install infrastructure
3. Put in on your site Drupal root
4. If you want to override it, build.properties
5. Customize variables
EXAMPLE TEST SUITE FOR SITE SUPPORT
Jenkins:
Scheduled 1AM User                     Jenkins: Clone
  Acceptance Test                Production to Test                                PHING: PHPUnit
                                                                              Configuration Load



                                 Jenkins & PHING: User          With Bootstrap and
  PHING: Selenium
                                Acceptance PHPUnit +            what Bootstrap file           Without
   Config Upload                      Selenium                    (ability to use            Bootstrap
                                                                   Drupal API)



PHING: Autodiscover
                                      PHING: Report
                                                                          PHING: Autodiscover
 the Selenium test                    Generated                             the PHPUnit test



                                                                        PHING: Trigger
                                                                                     each
                        Jenkins: If
                               errors
  PHING: Trigger each   found, notify                                    PHPUnit Test and
  Selenium test and     stakeholders                                      generate report
   generate report
                                                         Done
What is Selenium?


 •Selenium automates browsers. That's it. What you do with that power
  is entirely up to you. Primarily it is for automating web applications for
  testing purposes, but is certainly not limited to just that. Boring web-
  based administration tasks can (and should!) also be automated as
  well.
 •Selenium has the support of some of the largest browser vendors who
  have taken (or are taking) steps to make Selenium a native part of
  their browser. It is also the core technology in countless other browser
  automation tools, APIs and frameworks.
• Goes through every page
   • Makes sure header, footer, logos, etc
   • All branding elements in place
Functional Test PHPUnit


• Project Airbox
   • Checkout process that involves passing customer information to third party
     banking API, passes back customer ID
   • Months after completion, API changes broke the application
       • PHPUnit figures out how and where the problem is
       • More importantly, is there a problem?
• Major time saver for detective work
• -- bootstrap option to make use of forked upal without SUT
• https://github.com/chriscalip/upal
• http://drupal.org/node/1567500
• actually installs a complete Drupal site like the regular Drupal installer for every test
 being executed, using a random database prefix and some logic baked into Drupal's
 (regular runtime) core that re-routes all HTTP requests originating from WebTestBase
 into the "child site under test" (the db-prefixed one). Based on that, every test is able
 to specify additional modules to install into that child site, in order to test various
EXAMPLE TEST SUITE FOR DEVELOPMENT SITES

                   Guiding principle: Fast Iteration
Traditional Dev Staging Production and Workflow




           Manual             Manual             Manual

   Local                Dev            Staging            Production




            Lots of commits      Significant
                                 Event (Less
                                 Frequent)
Dev Staging Production Work Flow
with Automated Continuous
Integration Tests

                       Manual                                          Manual
        Manual
                                 Test
Local            Dev                                     Staging                 Production
                                Branch

                                                                 Automatic
                                                                 push if
                                Run Test                         passes
                                 Suite
                                           Jenkins: Clone   Staging DB to test
                                           DB

                                           Jenkins: Run   code-metrics test


                                           Jenkins:   Run user acceptance test


                                           Jenkins:
                                                  Run Drupal Core and
                                           Contribution Simple test
Manual Test


Jenkins: Clone Staging DB to test DB (5 mins)


Jenkins: Run code-metrics test (10-15 mins)


Jenkins: Run user acceptance test (10-15 mins)


Jenkins: Run Drupal Core and Contribution Simple test (Needs work)


Jenkins: RUN ALL (35 mins)
All those test eats up server resources ...


   .
Drupal
                                     ANATOMY OF USER ACCEPTANCE
                  Sites              TEST
                                                                        build.properties
                                                                        project.code.custom =
                                      All                               bathroom conference_room


                                                          Modules


# Chosen File Pattern by project for phpunit ie.. ExampleUnitTest.php bathroom
SampleUnitTest.php                                                          bathroomUnitTest.php
project.phpunit.filepattern = UnitTest.php                                  bathroomSeleniumTest.ph
                                                                                        p
# Selenium                                                            conference room
# Chosen File Pattern by project for selenium ie..
                                                                           conferenceroomUnitTest.ph
ExampleSeleniumTest.php SampleSeleniumTest.php                                         p
project.selenium.filepattern = SeleniumTest.php                         conferenceroomSeleniumTest.
                                                                                    php

                                                                       Kitchen (Contrib)
Example Jenkins Dashboard
Example of Code Metric Test
PHP Mess Detector
EXAMPLE OF PHPUNIT REPORT
GIT POST HOOK TRIGGERING THE TEST SUITE.
http://demosource.prometdev.com/blog


Dev writes the code & test             Client updates database
                                       • Finding a block with Selenium


                             • Dev pushes code
Questions?
www.prometsource.com

       chriscalip@prometsource.com
        johnnie@prometsource.com
            Twitter: @prometsource

More Related Content

What's hot (20)

KEY
How can you improve, harmonize and automate your development process using to...
John Ferguson Smart Limited
 
PDF
DevOps Game at SGZA
Dana Pylayeva
 
PDF
Making the case for Play Framework and Scala- Budapest Ping-Conf (2014)
ajevans
 
PDF
Measuring Web Performance - HighEdWeb Edition
Dave Olsen
 
PPTX
Standardizing WordPress Workflow
Digital Strategy Works LLC
 
PDF
Seven Jobs You Should Be Running #sqlsat126
Mike Hillwig
 
PDF
Community building lessons from Ansible
Greg DeKoenigsberg
 
PPTX
Bring Down the Wall of Confusion with Chocolate, LEGO and Scrum Simulation Game
Dana Pylayeva
 
PPTX
AATC - Gamifying DevOps with Lego and Chocolate Game
Dana Pylayeva
 
PPTX
Front End page speed performance improvements for Drupal
Andy Kucharski
 
PDF
Are You Really Using Kanban?
Tom Cudd
 
PPTX
Untangling spring week1
Derek Jacoby
 
PPTX
Optimizing Your WordPress Site: Why speed matters, and how to get there
Stephen Bell
 
PDF
The Seven DevOps Sins
Tom Cudd
 
PPT
Bootstrap + Drupal Commerce in less than 45 minutes!
Jorge Diaz
 
PDF
My Contributor Story
Marko Heijnen
 
PDF
Why I've Not bothered With Drupal 8
Robert Carr
 
PDF
wp cli- don’t fear the command line
Dwayne McDaniel
 
PDF
BADCamp 2012 -Beginner Best Practices
meghsweet
 
PDF
BADCamp 2012- Drupal Support
meghsweet
 
How can you improve, harmonize and automate your development process using to...
John Ferguson Smart Limited
 
DevOps Game at SGZA
Dana Pylayeva
 
Making the case for Play Framework and Scala- Budapest Ping-Conf (2014)
ajevans
 
Measuring Web Performance - HighEdWeb Edition
Dave Olsen
 
Standardizing WordPress Workflow
Digital Strategy Works LLC
 
Seven Jobs You Should Be Running #sqlsat126
Mike Hillwig
 
Community building lessons from Ansible
Greg DeKoenigsberg
 
Bring Down the Wall of Confusion with Chocolate, LEGO and Scrum Simulation Game
Dana Pylayeva
 
AATC - Gamifying DevOps with Lego and Chocolate Game
Dana Pylayeva
 
Front End page speed performance improvements for Drupal
Andy Kucharski
 
Are You Really Using Kanban?
Tom Cudd
 
Untangling spring week1
Derek Jacoby
 
Optimizing Your WordPress Site: Why speed matters, and how to get there
Stephen Bell
 
The Seven DevOps Sins
Tom Cudd
 
Bootstrap + Drupal Commerce in less than 45 minutes!
Jorge Diaz
 
My Contributor Story
Marko Heijnen
 
Why I've Not bothered With Drupal 8
Robert Carr
 
wp cli- don’t fear the command line
Dwayne McDaniel
 
BADCamp 2012 -Beginner Best Practices
meghsweet
 
BADCamp 2012- Drupal Support
meghsweet
 

Similar to Automated testing DrupalCamp in Asheville (20)

PPTX
Drupal & Continous Integration - SF State Study Case
Emanuele Quinto
 
PPTX
Automated testing with Drupal
Promet Source
 
PPTX
Continuous Test Automation via CI (CodeMash 2012) - Automating the Agile way
Leonard Fingerman
 
KEY
Continuous Delivery
Rob Spieldenner
 
PDF
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
manssandstrom
 
KEY
Don't touch that server
crdant
 
PDF
Jenkins_UserMeetup_Paris_201105
Gregory Boissinot
 
PPTX
MyHeritage - QA Automations in a Continuous Deployment environment
MatanGoren
 
ODP
2014 11 20 Drupal 7 -> 8 test migratie
hcderaad
 
PDF
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
Michael Lihs
 
PPTX
Scaling Continuous Integration Practices to Teams with Parallel Development
IBM UrbanCode Products
 
PDF
Automate your way to agility
Yuval Yeret
 
PDF
Taming the Deployment Beast
Chris Cornutt
 
PDF
Сontinuous Integration - step to continuous deployment
Игорь Родионов
 
PPTX
Continuous Delivery - Automate & Build Better Software with Travis CI
wajrcs
 
PPTX
Anatomy of a Build Pipeline
Samuel Brown
 
PDF
Drupal 7 ci and testing
Claudio Beatrice
 
PDF
Rocket Fuelled Cucumbers
Joseph Wilk
 
KEY
Improving code quality with continuous integration (PHPBenelux Conference 2011)
Martin de Keijzer
 
Drupal & Continous Integration - SF State Study Case
Emanuele Quinto
 
Automated testing with Drupal
Promet Source
 
Continuous Test Automation via CI (CodeMash 2012) - Automating the Agile way
Leonard Fingerman
 
Continuous Delivery
Rob Spieldenner
 
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
manssandstrom
 
Don't touch that server
crdant
 
Jenkins_UserMeetup_Paris_201105
Gregory Boissinot
 
MyHeritage - QA Automations in a Continuous Deployment environment
MatanGoren
 
2014 11 20 Drupal 7 -> 8 test migratie
hcderaad
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
Michael Lihs
 
Scaling Continuous Integration Practices to Teams with Parallel Development
IBM UrbanCode Products
 
Automate your way to agility
Yuval Yeret
 
Taming the Deployment Beast
Chris Cornutt
 
Сontinuous Integration - step to continuous deployment
Игорь Родионов
 
Continuous Delivery - Automate & Build Better Software with Travis CI
wajrcs
 
Anatomy of a Build Pipeline
Samuel Brown
 
Drupal 7 ci and testing
Claudio Beatrice
 
Rocket Fuelled Cucumbers
Joseph Wilk
 
Improving code quality with continuous integration (PHPBenelux Conference 2011)
Martin de Keijzer
 
Ad

More from Promet Source (20)

PPTX
How To Start Building Your Own Website With Drupal by Mary Chris Casis
Promet Source
 
PDF
DrupalCamp Cebu 2018 R&F by Andrew Kucharski
Promet Source
 
PDF
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
Promet Source
 
PDF
Migrating to-Drupal-8 by Bryan Manalo
Promet Source
 
PDF
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Promet Source
 
PDF
Drupal Development with Docker
Promet Source
 
PDF
Migrating Drupal 7 to Drupal 8
Promet Source
 
PPTX
Web Accessibility in Drupal
Promet Source
 
PDF
Drupal Continuous Integration and devops - Beyond Jenkins
Promet Source
 
PDF
Drupal 8 Involvement with Promet Source
Promet Source
 
PDF
Using Commerce License for Premium Content on Drupal Sites
Promet Source
 
PDF
Behavioral driven development with Behat
Promet Source
 
PDF
Composer tools and frameworks for Drupal
Promet Source
 
PDF
Responsive Design Testing the Promet Way
Promet Source
 
PDF
Optimize and succeed your next Fixed Budget Project planning process
Promet Source
 
PDF
Diy continuous integration
Promet Source
 
PPT
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Promet Source
 
PPT
Project Estimation Presentation - Donte's 8th level of estimating level of ef...
Promet Source
 
PPT
Open Source Software: An Edge For Your Growing Business
Promet Source
 
PPTX
Augmented Reality March Webinar
Promet Source
 
How To Start Building Your Own Website With Drupal by Mary Chris Casis
Promet Source
 
DrupalCamp Cebu 2018 R&F by Andrew Kucharski
Promet Source
 
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
Promet Source
 
Migrating to-Drupal-8 by Bryan Manalo
Promet Source
 
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Promet Source
 
Drupal Development with Docker
Promet Source
 
Migrating Drupal 7 to Drupal 8
Promet Source
 
Web Accessibility in Drupal
Promet Source
 
Drupal Continuous Integration and devops - Beyond Jenkins
Promet Source
 
Drupal 8 Involvement with Promet Source
Promet Source
 
Using Commerce License for Premium Content on Drupal Sites
Promet Source
 
Behavioral driven development with Behat
Promet Source
 
Composer tools and frameworks for Drupal
Promet Source
 
Responsive Design Testing the Promet Way
Promet Source
 
Optimize and succeed your next Fixed Budget Project planning process
Promet Source
 
Diy continuous integration
Promet Source
 
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Promet Source
 
Project Estimation Presentation - Donte's 8th level of estimating level of ef...
Promet Source
 
Open Source Software: An Edge For Your Growing Business
Promet Source
 
Augmented Reality March Webinar
Promet Source
 
Ad

Recently uploaded (20)

PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
July Patch Tuesday
Ivanti
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 

Automated testing DrupalCamp in Asheville

  • 2. About Promet Mission Statement: “Promet Solutions specializes in developing innovative, complex web applications with open source technology.” 30+ solutions architects 10 year in business th worldwide 32 open source contributions • Offices in the US • Chicago 10+ mobile apps in the past 12 months • San Jose
  • 3. ABOUT JOHNNIE: • Presenter • Johnnie Fox • @johnniefox • Promet Source • Director of Development • Scrum Master • Project Manager • Recovering Developer • @prometsource
  • 4. ABOUT CHRIS • Presenter Insert picture of Chris • Chris Calip • Promet Source • Application Developer • @prometsource
  • 5. HISTORY OF DRUPAL TESTING Drupal Testing: D6 core – Simpletest Application specific testing - Manual Tests - Written test cases – Word documents - The spreadsheet of pain. (Checklist) Challenges - Testing different browsers Reproducible results Providing a record Doesn’t test integration with 3rd party API (backend functionality)
  • 6. CONTINUOUS INTEGRATION: Continuous Integration (CI) implements continuous processes of applying quality control — small pieces of effort, applied frequently. Continuous integration aims to improve the quality of software, and to reduce the time taken to deliver it, by replacing the traditional practice of applying quality control after completing all development. Continuous Integration emerged in the Extreme Programming (XP) community, and XP advocates Martin Fowler and Kent Beck first wrote about continuous integration circa 1999. Continuous integration - Wikipedia, the free encyclopedia : taken from - http://en.wikipedia.org/wiki/Continuous_integrationhttp ://creativecommons.org/licenses/by-sa/3.0/
  • 7. HACKATHON TEAM : Five. Striving as one. Driven by a passion for continuous automated quality control. Ruoran Wang Scott Massey Chris Calip Johnnie Fox Michelle Krejci
  • 8. HACKATHON OBJECTIVE: Develop, deploy, demonstrate, and identify challenges of making using ci infrastructure to implement acceptance tests (unit tests, selenium) on one existing site.
  • 9. TECHNICAL DETAILS code metrics phpqatools.org user acceptance provisions servers with testing components admin gui to trigger test suites, or view reports
  • 10. Necessary components • For necessary components and installation instructions, go to: • Phing Drupal Template • http://reload.github.com/phing-drupal-template/ • Jenkins Drupal Template • http://reload.github.com/jenkins-drupal-template • Phing Drupal Template with User Acceptance Test • http://github.com/promet/phing-drupal-template • In addition for phing-drupal-template with user acceptance test, you need to install additional pear libraries • For more instructions, http://phpqatools.org/
  • 11. Installing Infrastructure Initial assumption: your server has several initial software already 1. Go to https://github.com/promet/phing-drupal-template 2. Three files that you need to use to install infrastructure 3. Put in on your site Drupal root 4. If you want to override it, build.properties 5. Customize variables
  • 12. EXAMPLE TEST SUITE FOR SITE SUPPORT
  • 13. Jenkins: Scheduled 1AM User Jenkins: Clone Acceptance Test Production to Test PHING: PHPUnit Configuration Load Jenkins & PHING: User With Bootstrap and PHING: Selenium Acceptance PHPUnit + what Bootstrap file Without Config Upload Selenium (ability to use Bootstrap Drupal API) PHING: Autodiscover PHING: Report PHING: Autodiscover the Selenium test Generated the PHPUnit test PHING: Trigger each Jenkins: If errors PHING: Trigger each found, notify PHPUnit Test and Selenium test and stakeholders generate report generate report Done
  • 14. What is Selenium? •Selenium automates browsers. That's it. What you do with that power is entirely up to you. Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web- based administration tasks can (and should!) also be automated as well. •Selenium has the support of some of the largest browser vendors who have taken (or are taking) steps to make Selenium a native part of their browser. It is also the core technology in countless other browser automation tools, APIs and frameworks. • Goes through every page • Makes sure header, footer, logos, etc • All branding elements in place
  • 15. Functional Test PHPUnit • Project Airbox • Checkout process that involves passing customer information to third party banking API, passes back customer ID • Months after completion, API changes broke the application • PHPUnit figures out how and where the problem is • More importantly, is there a problem? • Major time saver for detective work • -- bootstrap option to make use of forked upal without SUT • https://github.com/chriscalip/upal • http://drupal.org/node/1567500 • actually installs a complete Drupal site like the regular Drupal installer for every test being executed, using a random database prefix and some logic baked into Drupal's (regular runtime) core that re-routes all HTTP requests originating from WebTestBase into the "child site under test" (the db-prefixed one). Based on that, every test is able to specify additional modules to install into that child site, in order to test various
  • 16. EXAMPLE TEST SUITE FOR DEVELOPMENT SITES Guiding principle: Fast Iteration
  • 17. Traditional Dev Staging Production and Workflow Manual Manual Manual Local Dev Staging Production Lots of commits Significant Event (Less Frequent)
  • 18. Dev Staging Production Work Flow with Automated Continuous Integration Tests Manual Manual Manual Test Local Dev Staging Production Branch Automatic push if Run Test passes Suite Jenkins: Clone Staging DB to test DB Jenkins: Run code-metrics test Jenkins: Run user acceptance test Jenkins: Run Drupal Core and Contribution Simple test
  • 19. Manual Test Jenkins: Clone Staging DB to test DB (5 mins) Jenkins: Run code-metrics test (10-15 mins) Jenkins: Run user acceptance test (10-15 mins) Jenkins: Run Drupal Core and Contribution Simple test (Needs work) Jenkins: RUN ALL (35 mins)
  • 20. All those test eats up server resources ... .
  • 21. Drupal ANATOMY OF USER ACCEPTANCE Sites TEST build.properties project.code.custom = All bathroom conference_room Modules # Chosen File Pattern by project for phpunit ie.. ExampleUnitTest.php bathroom SampleUnitTest.php bathroomUnitTest.php project.phpunit.filepattern = UnitTest.php bathroomSeleniumTest.ph p # Selenium conference room # Chosen File Pattern by project for selenium ie.. conferenceroomUnitTest.ph ExampleSeleniumTest.php SampleSeleniumTest.php p project.selenium.filepattern = SeleniumTest.php conferenceroomSeleniumTest. php Kitchen (Contrib)
  • 23. Example of Code Metric Test PHP Mess Detector
  • 25. GIT POST HOOK TRIGGERING THE TEST SUITE. http://demosource.prometdev.com/blog Dev writes the code & test Client updates database • Finding a block with Selenium • Dev pushes code