automating microservices: what, where and when...automating microservices: what, where and when...
TRANSCRIPT
AUTOMATING MICROSERVICES:
WHAT, WHERE AND WHEN
Oleksandr RomanovIT Weekend Dnipro 2018
WHO AM I?
• 6+ years in test automation
• QA Automation Lead at Playtika
DICLAIMER
• All opinions are completely my own
• Microservices – backend architecture
• For hardcore code, check =>
The story so far
REGRESSION. RELEASE. REPEAT.
First automated tests…
CROSS BROWSER AUTOMATION
TESTS ON IE
Good old flakiness
MAYBE, API LEVEL TESTING?
CHILL OUT, HERO
HERE COMES
MICROSERVICES!
WINTER IS COMING?
MICROSERVICES?
WHAT THE HELL ARE
API LEVEL TESTING, AGAIN?
— YOUR ARCHITECT
«We need to release each microservice separately and fast».
THE PYRAMIDhttps://martinfowler.com/ar
ticles/microservice-testing/
MICROSERVICES TEST AUTOMATION APPROACH
GUIDE THROUGH THE LEVELS
Unit tests
• Implemented by developers
• Concentrated on positive and corner cases
• Mocking and stubbing are heavily used
Integration tests: what to test
• Persistence: SQL and NoSQL storages
• Gateway: HTTP REST, Messaging, RPC,
etc.
Integration tests: how to test
• In – memory solutions for testing
• Dependencies in docker containers
• Using SQLUnit / NoSQLUnit / scripts for test data
Component tests: what
• Testing main functionality of the microservice
• Testing corner cases if external services are unavailable
Component tests: how to test
• Testing through public / internal API
• Running service locally and / or dependencies in docker containers
Test Containers: https://bit.ly/2KYhc4N
Spring Boot Test Containers: https://bit.ly/2GTc13S
• Mocking out external services: e.g. via WireMock https://bit.ly/2pSFLZb
Contracttests: what
• Testing semantics
• Do not test functionality
Contract tests: example
Contract tests: how
PACT - https://bit.ly/2GUBIAX
Spring Cloud Contract - https://bit.ly/2GYi0Jy
End – to – End tests:
• Cover business flows
• Cover platform dependent cases
• Can be done on API or UI levels
So, what?
One badmicroservice?
Recommendations
• Sam Newman – Building Microservices https://oreil.ly/1pp6qmx
• Martin Fowler – Testing Strategies in Microservices https://bit.ly/2pWi0AA
To sum up:
• Automate each microservice separately
• Run locally as much tests as you can
• End - to - end tests are important too
Twitter: @al8xrSkype: alex_roma_nov
THANK YOU!