SlideShare a Scribd company logo
DOCKERIZE YOUR UNIT TESTS FOR
FASTER FEEDBACK
Let’s speed up your tests!
https://goo.gl/images/OdSqB4
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 2
FotobyAnnaFilinaatBGPHP16
Michelangelo van Dam
‣ Pro PHP consultant at in2it
‣ President of PHPBenelux
‣ Open-Source contributor
‣ Conference Speaker
‣ ZCE and ZF-CE
in itPROFESSIONAL PHP SERVICES
PHPUnit + Docker = 🚗💨 3
PHPUNIT
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 4
https://goo.gl/images/eBa0vw
EXTRAS TO RUN PHPUNIT
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 5
‣ Command-line?
‣ Run from IDE?
‣ Test server?
‣ Jenkins, TeamCity, Bamboo?
‣ Vagrant?
‣ Docker?
https://goo.gl/images/l0HXj7
DRAWBACKS
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 6
‣ Takes long time for many tests
‣ Environment not always ready for testing
‣ Tests don’t provide good feedback
https://goo.gl/images/TajZrP
SYSTEM FAILURES
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 7
‣ Memory Exhausted
‣ Disk full
‣ No network or network latency
‣ Systems crash
https://goo.gl/images/ruod6b
DOCKER
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 8
https://goo.gl/images/vhDEGy
WHAT IS DOCKER?
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 9
‣ Technology platform
‣ Run processes in separate containers
‣ Scales fast and seemlessly
‣ Containers are easy shippable
‣ Best next thing since sliced bread
https://goo.gl/images/xEfLk5
DOCKER USAGE
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 10
‣ Mimic distributed architectures
‣ Isolate applications
‣ Run single purpose commands
https://goo.gl/images/LIfWVb
DEMO TIME
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 11
RUN THEM ALL
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 12
https://goo.gl/images/grh4mu
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 13
USING @GROUP
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 14
https://www.flickr.com/photos/bgphp/21210790293
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 15
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 16
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 17
for i in `./vendor/bin/phpunit --list-groups | grep "^
-" | awk {'print $2'}`; do ./vendor/bin/phpunit --group
$i; done;
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 18
SHIP IT WITH DOCKER!!!
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 19
https://goo.gl/images/Fo0dVi
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 20
docker run -ti --rm -v "$PWD":/usr/src/myapp -w /usr/
src/myapp php:7.0-cli ./vendor/bin/phpunit
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 21
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 22
https://www.gnu.org/software/parallel/
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 23
for i in `./vendor/bin/phpunit —list-groups | grep "^
-“ | awk {'print $2'}`; do echo $i; done | /usr/local/
bin/parallel docker run -v "$PWD":/usr/src/myapp -w /
usr/src/myapp php:7.0-cli ./vendor/bin/phpunit --log-
junit=build/junit-{}.xml --group {}
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 24
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 25
for i in `./vendor/bin/phpunit —list-groups | grep "^
-“ | awk {'print $2'}`; do echo $i; done | time /usr/
local/bin/parallel docker run -d -v "$PWD":/usr/src/
myapp -w /usr/src/myapp php:7.0-cli ./vendor/bin/
phpunit --log-junit=build/junit-{}.xml --group {}
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 26
WHERE ARE MY FAILURES?
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 27
https://goo.gl/images/VWpYFO
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 28
for i in `./vendor/bin/phpunit --list-groups | grep "^
-" | awk {'print $2'}`; do echo $i; done | time
parallel docker run -d -v "$PWD":/var/run/phpunit -w /
var/run/phpunit --name pu-docker-{} php:7.0-cli /var/
run/phpunit/vendor/bin/phpunit --group {} && for i in
`./vendor/bin/phpunit --list-groups | grep "^ -" | awk
{'print $2'}`; do docker wait pu-docker-$i | grep -c 0
> /dev/null || docker logs pu-docker-$i && docker rm -f
pu-docker-$i > /dev/null; done;
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 29
‣ loop over our @group list entries
‣ run these in docker (daemonized)
‣ loop over our @group list entries
‣ fetch the exit status of phpunit from the containers
‣ if not 0 -> show us the failure
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 30
#FTW #PARTY #AWESOME
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 31
https://goo.gl/images/uWs8N0
OTHER SCENARIOS
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 32
‣ Test on different PHP versions
‣ Test separation based on TestSuite, Directory, …
‣ Testing long running integration tests separately
‣ Resilience testing
https://goo.gl/images/JnY8yr
QUESTIONS
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 33
https://goo.gl/images/mM3D3j
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 34
PHPUnit/Unit Testing
Ensure your apps are
of high quality
Zend Framework 2/3
Build robust web
applications
Azure PHP
Quick time to market
Scale up and out
jQuery
Professional jQuery
PHP 7
Learn the web language
that powers 80% of the
internet
On-site Training
Personal coaching and
mentoring on-site
Training courses 2016 - 2017
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 35
phpcon.eu
Ticket sales start soon!
January 27 & 28 in Antwerp (Belgium)
www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 36
https://goo.gl/images/dKsFdO

More Related Content

Viewers also liked

Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
toffermann
 
The road to php 7.1
The road to php 7.1The road to php 7.1
The road to php 7.1
Michelangelo van Dam
 
200K+ reasons security is a must
200K+ reasons security is a must200K+ reasons security is a must
200K+ reasons security is a must
Michelangelo van Dam
 
Code Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsCode Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application Migrations
Dana Luther
 
Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017
Colin O'Dell
 
Dip Your Toes in the Sea of Security
Dip Your Toes in the Sea of SecurityDip Your Toes in the Sea of Security
Dip Your Toes in the Sea of Security
James Titcumb
 
A World Without PHP
A World Without PHPA World Without PHP
A World Without PHP
Ben Marks
 
Learn To Test Like A Grumpy Programmer - 3 hour workshop
Learn To Test Like A Grumpy Programmer - 3 hour workshopLearn To Test Like A Grumpy Programmer - 3 hour workshop
Learn To Test Like A Grumpy Programmer - 3 hour workshop
chartjes
 
Amp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pagesAmp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pages
Robert McFrazier
 
A recommendation engine for your php application
A recommendation engine for your php applicationA recommendation engine for your php application
A recommendation engine for your php application
Michele Orselli
 
From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017
Chris Tankersley
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tiger
Elizabeth Smith
 
Testing strategies for Docker containers
Testing strategies for Docker containersTesting strategies for Docker containers
Testing strategies for Docker containers
Alexei Ledenev
 
WordPress for the modern PHP developer
WordPress for the modern PHP developerWordPress for the modern PHP developer
WordPress for the modern PHP developer
Chris Sherry
 
Docker Testing
Docker TestingDocker Testing
Docker Testing
Alex Soto
 
QA for PHP projects
QA for PHP projectsQA for PHP projects
QA for PHP projects
Michelangelo van Dam
 
Community works for business - LoneStarPHP 2014
Community works for business - LoneStarPHP 2014Community works for business - LoneStarPHP 2014
Community works for business - LoneStarPHP 2014
Michelangelo van Dam
 
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter DanesUsing Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
NLJUG
 
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOpsDevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
Sailaja Tennati
 

Viewers also liked (19)

Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
 
The road to php 7.1
The road to php 7.1The road to php 7.1
The road to php 7.1
 
200K+ reasons security is a must
200K+ reasons security is a must200K+ reasons security is a must
200K+ reasons security is a must
 
Code Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsCode Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application Migrations
 
Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017
 
Dip Your Toes in the Sea of Security
Dip Your Toes in the Sea of SecurityDip Your Toes in the Sea of Security
Dip Your Toes in the Sea of Security
 
A World Without PHP
A World Without PHPA World Without PHP
A World Without PHP
 
Learn To Test Like A Grumpy Programmer - 3 hour workshop
Learn To Test Like A Grumpy Programmer - 3 hour workshopLearn To Test Like A Grumpy Programmer - 3 hour workshop
Learn To Test Like A Grumpy Programmer - 3 hour workshop
 
Amp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pagesAmp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pages
 
A recommendation engine for your php application
A recommendation engine for your php applicationA recommendation engine for your php application
A recommendation engine for your php application
 
From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tiger
 
Testing strategies for Docker containers
Testing strategies for Docker containersTesting strategies for Docker containers
Testing strategies for Docker containers
 
WordPress for the modern PHP developer
WordPress for the modern PHP developerWordPress for the modern PHP developer
WordPress for the modern PHP developer
 
Docker Testing
Docker TestingDocker Testing
Docker Testing
 
QA for PHP projects
QA for PHP projectsQA for PHP projects
QA for PHP projects
 
Community works for business - LoneStarPHP 2014
Community works for business - LoneStarPHP 2014Community works for business - LoneStarPHP 2014
Community works for business - LoneStarPHP 2014
 
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter DanesUsing Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
 
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOpsDevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
 

More from Michelangelo van Dam

GDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and defaultGDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and default
Michelangelo van Dam
 
Moving from app services to azure functions
Moving from app services to azure functionsMoving from app services to azure functions
Moving from app services to azure functions
Michelangelo van Dam
 
Privacy by design
Privacy by designPrivacy by design
Privacy by design
Michelangelo van Dam
 
DevOps or DevSecOps
DevOps or DevSecOpsDevOps or DevSecOps
DevOps or DevSecOps
Michelangelo van Dam
 
Privacy by design
Privacy by designPrivacy by design
Privacy by design
Michelangelo van Dam
 
Continuous deployment 2.0
Continuous deployment 2.0Continuous deployment 2.0
Continuous deployment 2.0
Michelangelo van Dam
 
Let your tests drive your code
Let your tests drive your codeLet your tests drive your code
Let your tests drive your code
Michelangelo van Dam
 
General Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's storyGeneral Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's story
Michelangelo van Dam
 
Leveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantageLeveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantage
Michelangelo van Dam
 
Decouple your framework now, thank me later
Decouple your framework now, thank me laterDecouple your framework now, thank me later
Decouple your framework now, thank me later
Michelangelo van Dam
 
Deploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutesDeploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutes
Michelangelo van Dam
 
Azure and OSS, a match made in heaven
Azure and OSS, a match made in heavenAzure and OSS, a match made in heaven
Azure and OSS, a match made in heaven
Michelangelo van Dam
 
Getting hands dirty with php7
Getting hands dirty with php7Getting hands dirty with php7
Getting hands dirty with php7
Michelangelo van Dam
 
Zf2 how arrays will save your project
Zf2   how arrays will save your projectZf2   how arrays will save your project
Zf2 how arrays will save your project
Michelangelo van Dam
 
Create, test, secure, repeat
Create, test, secure, repeatCreate, test, secure, repeat
Create, test, secure, repeat
Michelangelo van Dam
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the tests
Michelangelo van Dam
 
Easily extend your existing php app with an api
Easily extend your existing php app with an apiEasily extend your existing php app with an api
Easily extend your existing php app with an api
Michelangelo van Dam
 
Your code are my tests
Your code are my testsYour code are my tests
Your code are my tests
Michelangelo van Dam
 
90K Reasons Security is a Must - PHPWorld 2014
90K Reasons Security is a Must - PHPWorld 201490K Reasons Security is a Must - PHPWorld 2014
90K Reasons Security is a Must - PHPWorld 2014
Michelangelo van Dam
 
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Michelangelo van Dam
 

More from Michelangelo van Dam (20)

GDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and defaultGDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and default
 
Moving from app services to azure functions
Moving from app services to azure functionsMoving from app services to azure functions
Moving from app services to azure functions
 
Privacy by design
Privacy by designPrivacy by design
Privacy by design
 
DevOps or DevSecOps
DevOps or DevSecOpsDevOps or DevSecOps
DevOps or DevSecOps
 
Privacy by design
Privacy by designPrivacy by design
Privacy by design
 
Continuous deployment 2.0
Continuous deployment 2.0Continuous deployment 2.0
Continuous deployment 2.0
 
Let your tests drive your code
Let your tests drive your codeLet your tests drive your code
Let your tests drive your code
 
General Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's storyGeneral Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's story
 
Leveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantageLeveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantage
 
Decouple your framework now, thank me later
Decouple your framework now, thank me laterDecouple your framework now, thank me later
Decouple your framework now, thank me later
 
Deploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutesDeploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutes
 
Azure and OSS, a match made in heaven
Azure and OSS, a match made in heavenAzure and OSS, a match made in heaven
Azure and OSS, a match made in heaven
 
Getting hands dirty with php7
Getting hands dirty with php7Getting hands dirty with php7
Getting hands dirty with php7
 
Zf2 how arrays will save your project
Zf2   how arrays will save your projectZf2   how arrays will save your project
Zf2 how arrays will save your project
 
Create, test, secure, repeat
Create, test, secure, repeatCreate, test, secure, repeat
Create, test, secure, repeat
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the tests
 
Easily extend your existing php app with an api
Easily extend your existing php app with an apiEasily extend your existing php app with an api
Easily extend your existing php app with an api
 
Your code are my tests
Your code are my testsYour code are my tests
Your code are my tests
 
90K Reasons Security is a Must - PHPWorld 2014
90K Reasons Security is a Must - PHPWorld 201490K Reasons Security is a Must - PHPWorld 2014
90K Reasons Security is a Must - PHPWorld 2014
 
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
 

Recently uploaded

ANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
ANATOMY OF SOA - Thomas Erl - Service Oriented ArchitectureANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
ANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
Divya Rajasekar
 
Hate speech detection using machine learning
Hate speech detection using machine learningHate speech detection using machine learning
Hate speech detection using machine learning
rakeshrocking3
 
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
Jim Mimlitz, P.E.
 
Presentation slide on DESIGN AND FABRICATION OF MOBILE CONTROLLED DRAINAGE.pptx
Presentation slide on DESIGN AND FABRICATION OF MOBILE CONTROLLED DRAINAGE.pptxPresentation slide on DESIGN AND FABRICATION OF MOBILE CONTROLLED DRAINAGE.pptx
Presentation slide on DESIGN AND FABRICATION OF MOBILE CONTROLLED DRAINAGE.pptx
Er. Kushal Ghimire
 
How to Formulate A Good Research Question
How to Formulate A  Good Research QuestionHow to Formulate A  Good Research Question
How to Formulate A Good Research Question
rkpv2002
 
Generative-AI-a-boost-for-operations-Presentation.pdf
Generative-AI-a-boost-for-operations-Presentation.pdfGenerative-AI-a-boost-for-operations-Presentation.pdf
Generative-AI-a-boost-for-operations-Presentation.pdf
Aries716858
 
Distillation-1.vapour liquid equilibrium
Distillation-1.vapour liquid equilibriumDistillation-1.vapour liquid equilibrium
Distillation-1.vapour liquid equilibrium
RjKing12
 
Traffic Engineering-MODULE-1 vtu syllabus.pptx
Traffic Engineering-MODULE-1 vtu syllabus.pptxTraffic Engineering-MODULE-1 vtu syllabus.pptx
Traffic Engineering-MODULE-1 vtu syllabus.pptx
mailmad391
 
Python programming Introduction about Python
Python programming Introduction about PythonPython programming Introduction about Python
Python programming Introduction about Python
Senthil Vit
 
Metrology Book, Bachelors in Mechanical Engineering
Metrology Book, Bachelors in Mechanical EngineeringMetrology Book, Bachelors in Mechanical Engineering
Metrology Book, Bachelors in Mechanical Engineering
leakingvideo
 
Introduction And Differences Between File System And Dbms.pptx
Introduction And Differences Between File System And Dbms.pptxIntroduction And Differences Between File System And Dbms.pptx
Introduction And Differences Between File System And Dbms.pptx
SerendipityYoon
 
the potential for the development of autonomous aircraft
the potential for the development of autonomous aircraftthe potential for the development of autonomous aircraft
the potential for the development of autonomous aircraft
huseindihon
 
Ludo system project report management .pdf
Ludo  system project report management .pdfLudo  system project report management .pdf
Ludo system project report management .pdf
Kamal Acharya
 
李易峰祝绪丹做爱视频流出【网芷:ht28.co】可爱学生妹>>>[网趾:ht28.co】]<<<
李易峰祝绪丹做爱视频流出【网芷:ht28.co】可爱学生妹>>>[网趾:ht28.co】]<<<李易峰祝绪丹做爱视频流出【网芷:ht28.co】可爱学生妹>>>[网趾:ht28.co】]<<<
李易峰祝绪丹做爱视频流出【网芷:ht28.co】可爱学生妹>>>[网趾:ht28.co】]<<<
amzhoxvzidbke
 
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptxOME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
shanmugamram247
 
Red Hat Enterprise Linux Administration 9.0 RH134 pdf
Red Hat Enterprise Linux Administration 9.0 RH134 pdfRed Hat Enterprise Linux Administration 9.0 RH134 pdf
Red Hat Enterprise Linux Administration 9.0 RH134 pdf
mdfkobir
 
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in CityGirls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
rawankhanlove256
 
readers writers Problem in operating system
readers writers Problem in operating systemreaders writers Problem in operating system
readers writers Problem in operating system
VADAPALLYPRAVEENKUMA1
 
FINE-TUNING OF SMALL/MEDIUM LLMS FOR BUSINESS QA ON STRUCTURED DATA
FINE-TUNING OF SMALL/MEDIUM LLMS FOR BUSINESS QA ON STRUCTURED DATAFINE-TUNING OF SMALL/MEDIUM LLMS FOR BUSINESS QA ON STRUCTURED DATA
FINE-TUNING OF SMALL/MEDIUM LLMS FOR BUSINESS QA ON STRUCTURED DATA
kevig
 
Software Engineering and Project Management - Activity Planning
Software Engineering and Project Management - Activity PlanningSoftware Engineering and Project Management - Activity Planning
Software Engineering and Project Management - Activity Planning
Prakhyath Rai
 

Recently uploaded (20)

ANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
ANATOMY OF SOA - Thomas Erl - Service Oriented ArchitectureANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
ANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
 
Hate speech detection using machine learning
Hate speech detection using machine learningHate speech detection using machine learning
Hate speech detection using machine learning
 
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
 
Presentation slide on DESIGN AND FABRICATION OF MOBILE CONTROLLED DRAINAGE.pptx
Presentation slide on DESIGN AND FABRICATION OF MOBILE CONTROLLED DRAINAGE.pptxPresentation slide on DESIGN AND FABRICATION OF MOBILE CONTROLLED DRAINAGE.pptx
Presentation slide on DESIGN AND FABRICATION OF MOBILE CONTROLLED DRAINAGE.pptx
 
How to Formulate A Good Research Question
How to Formulate A  Good Research QuestionHow to Formulate A  Good Research Question
How to Formulate A Good Research Question
 
Generative-AI-a-boost-for-operations-Presentation.pdf
Generative-AI-a-boost-for-operations-Presentation.pdfGenerative-AI-a-boost-for-operations-Presentation.pdf
Generative-AI-a-boost-for-operations-Presentation.pdf
 
Distillation-1.vapour liquid equilibrium
Distillation-1.vapour liquid equilibriumDistillation-1.vapour liquid equilibrium
Distillation-1.vapour liquid equilibrium
 
Traffic Engineering-MODULE-1 vtu syllabus.pptx
Traffic Engineering-MODULE-1 vtu syllabus.pptxTraffic Engineering-MODULE-1 vtu syllabus.pptx
Traffic Engineering-MODULE-1 vtu syllabus.pptx
 
Python programming Introduction about Python
Python programming Introduction about PythonPython programming Introduction about Python
Python programming Introduction about Python
 
Metrology Book, Bachelors in Mechanical Engineering
Metrology Book, Bachelors in Mechanical EngineeringMetrology Book, Bachelors in Mechanical Engineering
Metrology Book, Bachelors in Mechanical Engineering
 
Introduction And Differences Between File System And Dbms.pptx
Introduction And Differences Between File System And Dbms.pptxIntroduction And Differences Between File System And Dbms.pptx
Introduction And Differences Between File System And Dbms.pptx
 
the potential for the development of autonomous aircraft
the potential for the development of autonomous aircraftthe potential for the development of autonomous aircraft
the potential for the development of autonomous aircraft
 
Ludo system project report management .pdf
Ludo  system project report management .pdfLudo  system project report management .pdf
Ludo system project report management .pdf
 
李易峰祝绪丹做爱视频流出【网芷:ht28.co】可爱学生妹>>>[网趾:ht28.co】]<<<
李易峰祝绪丹做爱视频流出【网芷:ht28.co】可爱学生妹>>>[网趾:ht28.co】]<<<李易峰祝绪丹做爱视频流出【网芷:ht28.co】可爱学生妹>>>[网趾:ht28.co】]<<<
李易峰祝绪丹做爱视频流出【网芷:ht28.co】可爱学生妹>>>[网趾:ht28.co】]<<<
 
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptxOME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
 
Red Hat Enterprise Linux Administration 9.0 RH134 pdf
Red Hat Enterprise Linux Administration 9.0 RH134 pdfRed Hat Enterprise Linux Administration 9.0 RH134 pdf
Red Hat Enterprise Linux Administration 9.0 RH134 pdf
 
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in CityGirls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
 
readers writers Problem in operating system
readers writers Problem in operating systemreaders writers Problem in operating system
readers writers Problem in operating system
 
FINE-TUNING OF SMALL/MEDIUM LLMS FOR BUSINESS QA ON STRUCTURED DATA
FINE-TUNING OF SMALL/MEDIUM LLMS FOR BUSINESS QA ON STRUCTURED DATAFINE-TUNING OF SMALL/MEDIUM LLMS FOR BUSINESS QA ON STRUCTURED DATA
FINE-TUNING OF SMALL/MEDIUM LLMS FOR BUSINESS QA ON STRUCTURED DATA
 
Software Engineering and Project Management - Activity Planning
Software Engineering and Project Management - Activity PlanningSoftware Engineering and Project Management - Activity Planning
Software Engineering and Project Management - Activity Planning
 

Dockerize your unit tests for faster feedback

  • 1. DOCKERIZE YOUR UNIT TESTS FOR FASTER FEEDBACK Let’s speed up your tests! https://goo.gl/images/OdSqB4
  • 2. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 2 FotobyAnnaFilinaatBGPHP16
  • 3. Michelangelo van Dam ‣ Pro PHP consultant at in2it ‣ President of PHPBenelux ‣ Open-Source contributor ‣ Conference Speaker ‣ ZCE and ZF-CE in itPROFESSIONAL PHP SERVICES PHPUnit + Docker = 🚗💨 3
  • 4. PHPUNIT www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 4 https://goo.gl/images/eBa0vw
  • 5. EXTRAS TO RUN PHPUNIT www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 5 ‣ Command-line? ‣ Run from IDE? ‣ Test server? ‣ Jenkins, TeamCity, Bamboo? ‣ Vagrant? ‣ Docker? https://goo.gl/images/l0HXj7
  • 6. DRAWBACKS www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 6 ‣ Takes long time for many tests ‣ Environment not always ready for testing ‣ Tests don’t provide good feedback https://goo.gl/images/TajZrP
  • 7. SYSTEM FAILURES www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 7 ‣ Memory Exhausted ‣ Disk full ‣ No network or network latency ‣ Systems crash https://goo.gl/images/ruod6b
  • 8. DOCKER www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 8 https://goo.gl/images/vhDEGy
  • 9. WHAT IS DOCKER? www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 9 ‣ Technology platform ‣ Run processes in separate containers ‣ Scales fast and seemlessly ‣ Containers are easy shippable ‣ Best next thing since sliced bread https://goo.gl/images/xEfLk5
  • 10. DOCKER USAGE www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 10 ‣ Mimic distributed architectures ‣ Isolate applications ‣ Run single purpose commands https://goo.gl/images/LIfWVb
  • 11. DEMO TIME www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 11
  • 12. RUN THEM ALL www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 12 https://goo.gl/images/grh4mu
  • 13. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 13
  • 14. USING @GROUP www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 14 https://www.flickr.com/photos/bgphp/21210790293
  • 15. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 15
  • 16. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 16
  • 17. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 17 for i in `./vendor/bin/phpunit --list-groups | grep "^ -" | awk {'print $2'}`; do ./vendor/bin/phpunit --group $i; done;
  • 18. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 18
  • 19. SHIP IT WITH DOCKER!!! www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 19 https://goo.gl/images/Fo0dVi
  • 20. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 20 docker run -ti --rm -v "$PWD":/usr/src/myapp -w /usr/ src/myapp php:7.0-cli ./vendor/bin/phpunit
  • 21. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 21
  • 22. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 22 https://www.gnu.org/software/parallel/
  • 23. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 23 for i in `./vendor/bin/phpunit —list-groups | grep "^ -“ | awk {'print $2'}`; do echo $i; done | /usr/local/ bin/parallel docker run -v "$PWD":/usr/src/myapp -w / usr/src/myapp php:7.0-cli ./vendor/bin/phpunit --log- junit=build/junit-{}.xml --group {}
  • 24. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 24
  • 25. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 25 for i in `./vendor/bin/phpunit —list-groups | grep "^ -“ | awk {'print $2'}`; do echo $i; done | time /usr/ local/bin/parallel docker run -d -v "$PWD":/usr/src/ myapp -w /usr/src/myapp php:7.0-cli ./vendor/bin/ phpunit --log-junit=build/junit-{}.xml --group {}
  • 26. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 26
  • 27. WHERE ARE MY FAILURES? www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 27 https://goo.gl/images/VWpYFO
  • 28. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 28 for i in `./vendor/bin/phpunit --list-groups | grep "^ -" | awk {'print $2'}`; do echo $i; done | time parallel docker run -d -v "$PWD":/var/run/phpunit -w / var/run/phpunit --name pu-docker-{} php:7.0-cli /var/ run/phpunit/vendor/bin/phpunit --group {} && for i in `./vendor/bin/phpunit --list-groups | grep "^ -" | awk {'print $2'}`; do docker wait pu-docker-$i | grep -c 0 > /dev/null || docker logs pu-docker-$i && docker rm -f pu-docker-$i > /dev/null; done;
  • 29. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 29 ‣ loop over our @group list entries ‣ run these in docker (daemonized) ‣ loop over our @group list entries ‣ fetch the exit status of phpunit from the containers ‣ if not 0 -> show us the failure
  • 30. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 30
  • 31. #FTW #PARTY #AWESOME www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 31 https://goo.gl/images/uWs8N0
  • 32. OTHER SCENARIOS www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 32 ‣ Test on different PHP versions ‣ Test separation based on TestSuite, Directory, … ‣ Testing long running integration tests separately ‣ Resilience testing https://goo.gl/images/JnY8yr
  • 33. QUESTIONS www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 33 https://goo.gl/images/mM3D3j
  • 34. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 34 PHPUnit/Unit Testing Ensure your apps are of high quality Zend Framework 2/3 Build robust web applications Azure PHP Quick time to market Scale up and out jQuery Professional jQuery PHP 7 Learn the web language that powers 80% of the internet On-site Training Personal coaching and mentoring on-site Training courses 2016 - 2017
  • 35. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 35 phpcon.eu Ticket sales start soon! January 27 & 28 in Antwerp (Belgium)
  • 36. www.in2it.be - @in2itvof PHPUnit + Docker = 🚗💨 36 https://goo.gl/images/dKsFdO