Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Testing microservices the right way

Testing microservices the right way

Microservices shine in many aspects, but testability. Whenever you deploy a service, no matter how small it is, as long as it has dependencies, you have to keep them in mind. In Toptal, we realized the complexity of the integration testing when started our path from a monolithic application to microservices. In this talk, I’ll show what criteria we used to make a smart decision, what tools we haven’t chosen and how contract testing simplified our development flow and CI.

Tatiana Shepeleva

September 28, 2019
Tweet

More Decks by Tatiana Shepeleva

Other Decks in Technology

Transcript

  1. Record & Replay Polly.JS VCR Ruby ❌ ✅ JavaScript ✅

    ✅ Scala/JVM ❌ ✅ Elixir ❌ ✅ WebSocket support ✅ ❌ Easy to update tests ❌ ❌ Provider can’t break consumers ❌ ❌
  2. Fake servers Wiremock Mockserver Ruby ✅ ✅ JavaScript ✅ ✅

    Scala/JVM ✅ ✅ Elixir ❌ WebSocket support ❌ ❌ Easy to update tests ✅ ✅ Provider can’t break consumers ❌ ❌
  3. Contract tests Spring Cloud Pact Ruby ❌ ✅ JavaScript ❌

    ✅ Scala/JVM ✅ ✅ Elixir ❌ Web Socket support Easy to update tests ✅ ✅ Provider can’t break consumers ✅ ✅
  4. Pact • Support different languages (Ruby, JS, Go, PHP, Python,

    JVM) • Framework-agnostic • Language-agnostic contract (JSON)
  5. Pact Broker • Stores versions and tags • Webhooks to

    trigger checks or notifications • can-i-deploy tool
  6. The Right Way • 10 instead of 3800 min •

    Contract tests are a part of unit tests • Number of end-to-end tests minimal