Worked at CRITICAL Software, Banco BPI and Farfetch Worked in software testing for 5+ years Test Automation Lead @ Farfetch Senior Infrastructure Engineer @ Farfetch SeleniumConf UK 2016
• Safari Mac, Chrome Windows, Safari iPhone, Safari iPad, Chrome Android • Team motivation goes down • Pipelines are difficult to maintain and environments are unstable • Continuous delivery… yeah right
• Spread the pain across smaller applications • Easier, faster and cheaper to test and deploy By @alvaro_sanchez (twitter) as referred in http://www.wwwlicious.com/2016/05/03/servicestack- microservices-1/
and service have common needs • Teams don’t have to deal with browser setup and teardown (cache, cookies) • Common page elements (dropdowns, textboxes, …) • Make automation easier • Framework that does magic and science
layers (services, SQLServer, Cassandra, ... ) Simulate business flows without touching UI • Connectivity • Fast enough • Stability • Not as fast and precise as unit tests • Difficult to implement if not using modular or microservices architecture
Firefox, Safari, Edge, …) Test what the end user will see Cover happy paths • Allow end to end testing • Test the system as a whole: with all its dependencies • Expensive • Slow to run • Not so stable • Temptation to only have UI tests - because they actually allow to test everything
Test if the contract established between a service and an application is still being respected Backwards compatible in new versions Example of tools: PACT tests Provider Consumer Consumer Consumer Contract
Integration: App A tests integration with App B Isolation: App B tests itself Integration: App B tests integration with App C Contract: App B tests if it respects the contract with App A App A App B App C
the night Run tests in parallel Have powerful and reliable test targets SeleniumGrid with horizontal scaling with Docker and Kubernetes Jenkins slaves created on demand with Kubernetes
• When a VM gets “sick”, you call 112 / 911 so that some one fixes them • SeleniumGrid in VMs is hard to scale • When a container gets “sick”, you just dispose it and recreate a new one • Easy to scale using Kubernetes • ReplicationController assures SeleniumGrid is healthy • Bonus: for a scalable Jenkins with Kubernetes, check out the Jenkins X project
becomes difficult and error prone It’s difficult to keep track of changes More and more test instability due to not reliable environments Not enough CI/CD resources Solution based on 3 principles • Easy to use CI/CD Infrastructure as code (pipelines & environments as code) • Create, dispose, recreate • Autonomy for teams
across your teams • Give teams autonomy to configure their own pipelines • Abstract pipelines DSL / scripting languages complexity • Provide pipeline code reuse - avoid copy-paste code • Pipeline code should be simple and standard
the build file, the pipeline creates the whole infrastructure on the fly, then disposes it, and then recreates it. And all of this is scripted by code • Some techs you can use: CI/CD (Jenkins), Configuration Management (SaltStack, Chef, Puppet), Cloud Infrastructure Orchestration (Terraform, SaltCloud), Cloud APIs (AWS, MS Azure, Google Cloud Platform), Docker, Kubernetes
you build software in such a way that the software can be released to production at any time.” Martin Fowler “Safely and quickly in a sustainable way.” Jezz Humble
pain -> smaller pains Choose good testing tools - choose levels and types of tests wisely Optimize your tests and your infrastructure Metrics, metrics, metrics Provide product teams powerful, easy to use pipelines and stable environments Automation is not “one approach fits all”. Choose what's best for you. Thank you! André Carmo [email protected] github.com/atmcarmo @atmcarmo andrecarmo