SlideShare uma empresa Scribd logo
1 de 15
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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

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