SlideShare a Scribd company logo
1 of 15
Download to read offline
PHP, QA, and Jenkins
Eric Cope
June 25, 2013
http://voltampmedia.com
About Me
• I run Voltamp Media Inc., a 1-man web-dev
shop
• PHP-literate since 2002
• CodeIgniter since 2005 (1.6 whenever that
was)
• Bitten by the TDD bug around 2006
• Met Hudson/Jenkins in 2011
The Tools
• Jenkins - http://jenkins-ci.org
– Continuous Integration Tool
– Basic install is a quick download then:
• java –jar jenkins.war
• Normal vs. LTS
– For bigger installations, its recommended to run within a
java container, like Tomcat.
• PHPUnit – http://phpqatools.org
– A set of QA tools
– Installation is via PEAR
• Selenium – http://seleniumhq.org/
– java -jar selenium-server-standalone-2.31.0.jar
Getting Started
• Open a browser to:
– http://localhost:8080
Managing Jenkins
• File System Location
– Config files
– Project build areas
– Manage plugins
• Start from here - http://jenkins-php.org/
• Get the plugins
Static Code Analysis Plug-ins Clover PHP Plugin Plot plugin
DRY Plugin Checkstyle Plugin PMD Plugin
Git Plugin HTML Publisher Plugin xUnit Plugin
The First Job
• Each job must be configured!
– Source Code – how to get the code
– Build triggers (poll SCM, commit hooks)
– Build Steps
• Scripts (very limited environment)
• Maven
• Ant – see http://jenkins-php.org/ for yours!
– Post Build Steps
• Plots, reports
The ANT Script
• This is auto-generated,
then modified as
needed
• Test by running:
% ant /path/to/build.xml
• More at
http://ant.apache.or
g
The PHPUnit Script
• This is auto-generated, then modified as needed too
• Test by running: % phpunit
PHPUnit Tips and Tricks - fixtures
• YAML files can be used within a fixture
PHPUnit Tips and Tricks – data
providers
• YAML files can
be used as a
data provider
too
– Calls the provider
(returns an array)
– For each row it calls the
test
• The YAML is
different!
PHPUnit Tips and Tricks – Exceptions
• Test your exceptions!
• Check exception class and code
Bonus! PHPUnit and Selenium
• Make Jenkins drive PHPUnit drive Selenium!
My Issues - controller
• My current projects use CodeIgniter. CIUnit
makes using PHPUnit and CI better, but setup
is painful.
– End case of parent controller
• Correct parent class in setUp, but not in the
testMethod!
• MY_Controller vs. Controller
– $this->CI = set_controller('MY_Controller');
My Issues - Selenium
• Selenium has matured quite a bit, but
documentation and support is still very lean.
• PHPUnit’s Selenium2 class is much better, but still
leaves much to be desired.
– Click() does not wait for the page to load after a form
submission. Selenese supported clickandwait(), but I
can’t find documentation…
– https://github.com/sebastianbergmann/phpunit-
selenium/blob/master/Tests/Selenium2TestCaseTest.p
hp
– http://stackoverflow.com/questions/9102505/phpunit
-with-selenium
Still to Learn/Do
• Mocks
• Dependency Injection
• Code Coverage
• DRY-er!
• More Integration coverage with Selenium
• Exclude External Libraries in analysis || fix
them!
• Better TDD / BDD

More Related Content

What's hot

On premise cross-browser testing
On premise cross-browser testingOn premise cross-browser testing
On premise cross-browser testingDaniel Herken
 
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011camp_drupal_ua
 
Rails automatic test driven development
Rails automatic test driven developmentRails automatic test driven development
Rails automatic test driven developmenttyler4long
 
Moving From a Selenium Grid to the Cloud - A Real Life Story
Moving From a Selenium Grid to the Cloud - A Real Life StoryMoving From a Selenium Grid to the Cloud - A Real Life Story
Moving From a Selenium Grid to the Cloud - A Real Life StorySauce Labs
 
Appium & Robot Framework
Appium & Robot FrameworkAppium & Robot Framework
Appium & Robot FrameworkFurkan Ertürk
 
DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016Justin Ison
 
Belfast Selenium Meetup
Belfast Selenium MeetupBelfast Selenium Meetup
Belfast Selenium MeetupJustin Ison
 
Selenium Israel Meetup
Selenium Israel MeetupSelenium Israel Meetup
Selenium Israel MeetupJustin Ison
 
Selenium Automation at Incapsula
Selenium Automation at IncapsulaSelenium Automation at Incapsula
Selenium Automation at Incapsulaadamcarmi
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'tsPekka Klärck
 
"Framework Principal" pattern
"Framework Principal" pattern"Framework Principal" pattern
"Framework Principal" patternWO Community
 
[131] packetbeat과 elasticsearch
[131] packetbeat과 elasticsearch[131] packetbeat과 elasticsearch
[131] packetbeat과 elasticsearchNAVER D2
 
Training Slides: 254 - Using the Tungsten Replicator AMI
Training Slides: 254 - Using the Tungsten Replicator AMITraining Slides: 254 - Using the Tungsten Replicator AMI
Training Slides: 254 - Using the Tungsten Replicator AMIContinuent
 
What you can do with WordPress Heartbeat API
What you can do with WordPress Heartbeat APIWhat you can do with WordPress Heartbeat API
What you can do with WordPress Heartbeat APITabitha Chapman
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable productJulian Simpson
 
Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12Franz Allan See
 
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
 

What's hot (20)

On premise cross-browser testing
On premise cross-browser testingOn premise cross-browser testing
On premise cross-browser testing
 
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
 
Rails automatic test driven development
Rails automatic test driven developmentRails automatic test driven development
Rails automatic test driven development
 
Moving From a Selenium Grid to the Cloud - A Real Life Story
Moving From a Selenium Grid to the Cloud - A Real Life StoryMoving From a Selenium Grid to the Cloud - A Real Life Story
Moving From a Selenium Grid to the Cloud - A Real Life Story
 
Appium & Robot Framework
Appium & Robot FrameworkAppium & Robot Framework
Appium & Robot Framework
 
DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016
 
Belfast Selenium Meetup
Belfast Selenium MeetupBelfast Selenium Meetup
Belfast Selenium Meetup
 
Selenium Israel Meetup
Selenium Israel MeetupSelenium Israel Meetup
Selenium Israel Meetup
 
Sonarjenkins ajip
Sonarjenkins ajipSonarjenkins ajip
Sonarjenkins ajip
 
Selenium Automation at Incapsula
Selenium Automation at IncapsulaSelenium Automation at Incapsula
Selenium Automation at Incapsula
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'ts
 
"Framework Principal" pattern
"Framework Principal" pattern"Framework Principal" pattern
"Framework Principal" pattern
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
[131] packetbeat과 elasticsearch
[131] packetbeat과 elasticsearch[131] packetbeat과 elasticsearch
[131] packetbeat과 elasticsearch
 
Training Slides: 254 - Using the Tungsten Replicator AMI
Training Slides: 254 - Using the Tungsten Replicator AMITraining Slides: 254 - Using the Tungsten Replicator AMI
Training Slides: 254 - Using the Tungsten Replicator AMI
 
What you can do with WordPress Heartbeat API
What you can do with WordPress Heartbeat APIWhat you can do with WordPress Heartbeat API
What you can do with WordPress Heartbeat API
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable product
 
Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
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
 

Viewers also liked

Travis-CI - Continuos integration in the cloud for PHP
Travis-CI - Continuos integration in the cloud for PHPTravis-CI - Continuos integration in the cloud for PHP
Travis-CI - Continuos integration in the cloud for PHPFederico Damián Lozada Mosto
 
Travis CI – what's inside?
Travis CI – what's inside?Travis CI – what's inside?
Travis CI – what's inside?Olga Lavrentieva
 
Continuous Integration In A PHP World
Continuous Integration In A PHP WorldContinuous Integration In A PHP World
Continuous Integration In A PHP WorldIdaf_1er
 
Testing your app with Selenium on Travis CI
Testing your app with Selenium on Travis CITesting your app with Selenium on Travis CI
Testing your app with Selenium on Travis CIYusuke Ando
 

Viewers also liked (6)

Travis CI - PHP
Travis CI - PHPTravis CI - PHP
Travis CI - PHP
 
Travis CI & PHP
Travis CI & PHPTravis CI & PHP
Travis CI & PHP
 
Travis-CI - Continuos integration in the cloud for PHP
Travis-CI - Continuos integration in the cloud for PHPTravis-CI - Continuos integration in the cloud for PHP
Travis-CI - Continuos integration in the cloud for PHP
 
Travis CI – what's inside?
Travis CI – what's inside?Travis CI – what's inside?
Travis CI – what's inside?
 
Continuous Integration In A PHP World
Continuous Integration In A PHP WorldContinuous Integration In A PHP World
Continuous Integration In A PHP World
 
Testing your app with Selenium on Travis CI
Testing your app with Selenium on Travis CITesting your app with Selenium on Travis CI
Testing your app with Selenium on Travis CI
 

Similar to Azphp phpunit-jenkins

Super chargeyourcontiniousintegrationdeployments
Super chargeyourcontiniousintegrationdeploymentsSuper chargeyourcontiniousintegrationdeployments
Super chargeyourcontiniousintegrationdeploymentsNikola Gotsev
 
Supercharge Your Continuous Integration Deployments
Supercharge Your Continuous Integration DeploymentsSupercharge Your Continuous Integration Deployments
Supercharge Your Continuous Integration DeploymentsNikola Gotsev
 
[Japan Selenium User Community in Remote] Test Automation Journey
[Japan Selenium User Community in Remote] Test Automation Journey[Japan Selenium User Community in Remote] Test Automation Journey
[Japan Selenium User Community in Remote] Test Automation JourneyWoohyeok Kim
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsSISTechnologies
 
Selenium for everyone
Selenium for everyoneSelenium for everyone
Selenium for everyoneTft Us
 
KrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfKrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfQA or the Highway
 
Php com con-2011
Php com con-2011Php com con-2011
Php com con-2011LB Denker
 
Context Driven Automation Gtac 2008
Context Driven Automation Gtac 2008Context Driven Automation Gtac 2008
Context Driven Automation Gtac 2008Pete Schneider
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release WorkflowTuenti
 
Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)AOE
 
Php unit for drupal 8
Php unit for drupal 8Php unit for drupal 8
Php unit for drupal 8valuebound
 
Testing Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user groupTesting Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user groupViktor Gamov
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with DrupalPromet Source
 
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen..."Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...ConSol Consulting & Solutions Software GmbH
 
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen..."Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...ConSol Consulting & Solutions Software GmbH
 
Training Slides: 103 - Basics - Simple Tungsten Clustering Installation
Training Slides: 103 - Basics - Simple Tungsten Clustering InstallationTraining Slides: 103 - Basics - Simple Tungsten Clustering Installation
Training Slides: 103 - Basics - Simple Tungsten Clustering InstallationContinuent
 
Maven: from Scratch to Production (.pdf)
Maven: from Scratch to Production (.pdf)Maven: from Scratch to Production (.pdf)
Maven: from Scratch to Production (.pdf)Johan Mynhardt
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsAchievers Tech
 

Similar to Azphp phpunit-jenkins (20)

Super chargeyourcontiniousintegrationdeployments
Super chargeyourcontiniousintegrationdeploymentsSuper chargeyourcontiniousintegrationdeployments
Super chargeyourcontiniousintegrationdeployments
 
Supercharge Your Continuous Integration Deployments
Supercharge Your Continuous Integration DeploymentsSupercharge Your Continuous Integration Deployments
Supercharge Your Continuous Integration Deployments
 
PhpUnit & web driver
PhpUnit & web driverPhpUnit & web driver
PhpUnit & web driver
 
[Japan Selenium User Community in Remote] Test Automation Journey
[Japan Selenium User Community in Remote] Test Automation Journey[Japan Selenium User Community in Remote] Test Automation Journey
[Japan Selenium User Community in Remote] Test Automation Journey
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOps
 
Selenium practical
Selenium practicalSelenium practical
Selenium practical
 
Selenium for everyone
Selenium for everyoneSelenium for everyone
Selenium for everyone
 
KrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfKrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdf
 
Php com con-2011
Php com con-2011Php com con-2011
Php com con-2011
 
Context Driven Automation Gtac 2008
Context Driven Automation Gtac 2008Context Driven Automation Gtac 2008
Context Driven Automation Gtac 2008
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
 
Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)
 
Php unit for drupal 8
Php unit for drupal 8Php unit for drupal 8
Php unit for drupal 8
 
Testing Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user groupTesting Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user group
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with Drupal
 
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen..."Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
 
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen..."Using Automation Tools To Deploy And Operate Applications In Real World Scen...
"Using Automation Tools To Deploy And Operate Applications In Real World Scen...
 
Training Slides: 103 - Basics - Simple Tungsten Clustering Installation
Training Slides: 103 - Basics - Simple Tungsten Clustering InstallationTraining Slides: 103 - Basics - Simple Tungsten Clustering Installation
Training Slides: 103 - Basics - Simple Tungsten Clustering Installation
 
Maven: from Scratch to Production (.pdf)
Maven: from Scratch to Production (.pdf)Maven: from Scratch to Production (.pdf)
Maven: from Scratch to Production (.pdf)
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
 

Recently uploaded

Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfROWELL MARQUINA
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneUiPathCommunity
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 

Recently uploaded (20)

Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyone
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 

Azphp phpunit-jenkins

  • 1. PHP, QA, and Jenkins Eric Cope June 25, 2013 http://voltampmedia.com
  • 2. About Me • I run Voltamp Media Inc., a 1-man web-dev shop • PHP-literate since 2002 • CodeIgniter since 2005 (1.6 whenever that was) • Bitten by the TDD bug around 2006 • Met Hudson/Jenkins in 2011
  • 3. The Tools • Jenkins - http://jenkins-ci.org – Continuous Integration Tool – Basic install is a quick download then: • java –jar jenkins.war • Normal vs. LTS – For bigger installations, its recommended to run within a java container, like Tomcat. • PHPUnit – http://phpqatools.org – A set of QA tools – Installation is via PEAR • Selenium – http://seleniumhq.org/ – java -jar selenium-server-standalone-2.31.0.jar
  • 4. Getting Started • Open a browser to: – http://localhost:8080
  • 5. Managing Jenkins • File System Location – Config files – Project build areas – Manage plugins • Start from here - http://jenkins-php.org/ • Get the plugins Static Code Analysis Plug-ins Clover PHP Plugin Plot plugin DRY Plugin Checkstyle Plugin PMD Plugin Git Plugin HTML Publisher Plugin xUnit Plugin
  • 6. The First Job • Each job must be configured! – Source Code – how to get the code – Build triggers (poll SCM, commit hooks) – Build Steps • Scripts (very limited environment) • Maven • Ant – see http://jenkins-php.org/ for yours! – Post Build Steps • Plots, reports
  • 7. The ANT Script • This is auto-generated, then modified as needed • Test by running: % ant /path/to/build.xml • More at http://ant.apache.or g
  • 8. The PHPUnit Script • This is auto-generated, then modified as needed too • Test by running: % phpunit
  • 9. PHPUnit Tips and Tricks - fixtures • YAML files can be used within a fixture
  • 10. PHPUnit Tips and Tricks – data providers • YAML files can be used as a data provider too – Calls the provider (returns an array) – For each row it calls the test • The YAML is different!
  • 11. PHPUnit Tips and Tricks – Exceptions • Test your exceptions! • Check exception class and code
  • 12. Bonus! PHPUnit and Selenium • Make Jenkins drive PHPUnit drive Selenium!
  • 13. My Issues - controller • My current projects use CodeIgniter. CIUnit makes using PHPUnit and CI better, but setup is painful. – End case of parent controller • Correct parent class in setUp, but not in the testMethod! • MY_Controller vs. Controller – $this->CI = set_controller('MY_Controller');
  • 14. My Issues - Selenium • Selenium has matured quite a bit, but documentation and support is still very lean. • PHPUnit’s Selenium2 class is much better, but still leaves much to be desired. – Click() does not wait for the page to load after a form submission. Selenese supported clickandwait(), but I can’t find documentation… – https://github.com/sebastianbergmann/phpunit- selenium/blob/master/Tests/Selenium2TestCaseTest.p hp – http://stackoverflow.com/questions/9102505/phpunit -with-selenium
  • 15. Still to Learn/Do • Mocks • Dependency Injection • Code Coverage • DRY-er! • More Integration coverage with Selenium • Exclude External Libraries in analysis || fix them! • Better TDD / BDD