At Findly we know test automation is key for continuous delivery. However, in the context of a microservices architecture, our monolithic end-to-end test suites have still been limiting our ability to achieve a truly "continuous" pace of delivery. This talk will explain the principles, processes and techniques we are now using to build test suites for microservices and enable continuous delivery at Findly.
Presented at Auckland Continuous Delivery meetup, May 2016 (http://www.meetup.com/Auckland-Continuous-Delivery/events/230864194/).
4. Contents
Background
Why Testing, Why Microservices, Test Scopes, Test Pyramid,
Common Issues
Our Approach
Types of Test, CD Pipeline, Test Suite Metrics
Future Work
Mock Services, Partial Envs, Non-Functionals
21. Unit Test
What Test functions/objects in isolation from other
collaborating components.
How Test in-process with mocks + sometimes use real DB
(integration test).
When Impl: same commit as functional change.
Run: every pull request.
Who Dev
23. Functional Test
What Test app via its API in isolation from other collaborating
components.
How Cucumber test suite + real DB + real message broker +
mock dependencies.
When Spec: first task when story picked up.
Impl: before story “done”.
Run: every pull request + nightly for real env.
Who Spec: PO + Devs + Tester.
Impl: Devs (mostly) + Tester.
25. Example Functional Test Spec
@MBP-396.AC1
Scenario: Health check
Given The application has been started
When the health check URL is queried
Then it returns a valid status message
26. Functional Test Guidelines
★ Test suite talks to APIs
★ May use real dependencies
★ Create and clean up data
★ Run on every pull request in containers
★ Run against real HA environment nightly
★ Avoid testing orthogonal permutations
★ Collaboration between product owner, tester and developers
27. End-to-End Test
What Test app in fully integrated environment.
How Cucumber tests talking to real neighbouring services.
When Impl: before story “done” if new integration.
Run: nightly + after each deploy.
Who Spec: PO + Devs + Tester.
Impl: Devs + Tester (mostly).
29. Example E2E Test Spec
@MBP-1616.AC4 @e2e
Scenario: Imported Log10 profile is available from Profile Service
Given The log10 e2e org is set up
When a profile is posted to the E2E org's Log10 endpoint
Then the profile can be retrieved from the Profile Service
30. CD Pipeline
Local CI QA
Pre
Prod
Prod
Unit Test +
Functional Test
(partial)
Pull
request
Manual
promote
Manual
promote
Manual
promote
Unit Test +
Functional Test
Functional Test E2E Test E2E Test
(also run
nightly)
(also run
nightly)
40. Books
“How Google Tests Software”
James Whittaker
“Building Microservices”
Sam Newman
Further Reading
Articles
“Testing Strategies in Microservices
Architecture”
Toby Clemson - Thoughtworks
http://martinfowler.com/articles/microservice-testing/
“Just Say No to More End to End Tests”
Mike Wacker - Google
http://googletesting.blogspot.co.nz/2015/04/just-say-
no-to-more-end-to-end-tests.html
“Guidelines for Structuring Automated Tests”
Sunit Parekh - Thoughtworks
https://www.thoughtworks.
com/insights/blog/guidelines-structuring-automated-
tests