SlideShare a Scribd company logo
1 of 36
Download to read offline
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 Dockertoffermann
Β 
200K+ reasons security is a must
200K+ reasons security is a must200K+ reasons security is a must
200K+ reasons security is a mustMichelangelo 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 MigrationsDana Luther
Β 
Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017Colin 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 SecurityJames Titcumb
Β 
A World Without PHP
A World Without PHPA World Without PHP
A World Without PHPBen 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 workshopchartjes
Β 
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 pagesRobert 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 applicationMichele Orselli
Β 
From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017Chris Tankersley
Β 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tigerElizabeth Smith
Β 
Testing strategies for Docker containers
Testing strategies for Docker containersTesting strategies for Docker containers
Testing strategies for Docker containersAlexei Ledenev
Β 
WordPress for the modern PHP developer
WordPress for the modern PHP developerWordPress for the modern PHP developer
WordPress for the modern PHP developerChris Sherry
Β 
Docker Testing
Docker TestingDocker Testing
Docker TestingAlex Soto
Β 
Community works for business - LoneStarPHP 2014
Community works for business - LoneStarPHP 2014Community works for business - LoneStarPHP 2014
Community works for business - LoneStarPHP 2014Michelangelo 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 DanesNLJUG
Β 
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 DevOpsSailaja 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 defaultMichelangelo 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 functionsMichelangelo van Dam
Β 
Let your tests drive your code
Let your tests drive your codeLet your tests drive your code
Let your tests drive your codeMichelangelo 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 storyMichelangelo 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 advantageMichelangelo 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 laterMichelangelo 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 minutesMichelangelo 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 heavenMichelangelo van Dam
Β 
Getting hands dirty with php7
Getting hands dirty with php7Getting hands dirty with php7
Getting hands dirty with php7Michelangelo 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 projectMichelangelo van Dam
Β 
Create, test, secure, repeat
Create, test, secure, repeatCreate, test, secure, repeat
Create, test, secure, repeatMichelangelo 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 testsMichelangelo 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 apiMichelangelo 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 2014Michelangelo 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 2014Michelangelo 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

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
Β 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
Β 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
Β 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
Β 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
Β 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEslot gacor bisa pakai pulsa
Β 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
Β 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
Β 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
Β 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
Β 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
Β 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
Β 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
Β 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
Β 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
Β 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
Β 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
Β 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
Β 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
Β 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
Β 

Recently uploaded (20)

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Β 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
Β 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Β 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
Β 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
Β 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
Β 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
Β 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Β 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
Β 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
Β 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Β 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
Β 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Β 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
Β 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
Β 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
Β 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Β 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Β 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
Β 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
Β 

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