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
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)
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