~/talk

Effectively Testing Services

Talkat RailsConf 2014 · 2014-04-22..04-25· [testing, microservices]
name:Neal Kemp
links:none on file
slides:none on file

Shows actual tactics and results: use webmock to block real network calls, use vcr cassettes to record real responses and detect unexpected diffs, mount a sham_rack Sinatra fake for dynamic responses, and use the Charles proxy or Postman/HTTPie to capture real requests. Demonstrates catching real API failures (array turns into single object, id versus code inconsistencies), handling no-version APIs, and whether recorded responses make tests fast, reliable, and repeatable.

AI-written summary · about

  1. 0:00Intro
  2. 0:46what, why & how railsconf of testing services
  3. 1:24What is a service?
  4. 1:46Any time you make an HTTP request to an endpoint in another repository
  5. 2:42Why is testing services important? You (should) test everything else Services compose crucial features You may encounter problem...
  6. 3:17Internal API Sometimes null responses Inconsistencies Catastrophe
  7. 4:50id": 24 "code" : "ANA
  8. 5:24No versioning!
  9. 6:35What is different about services? External network requests You don't own the code
  10. 7:06On an airplane... Failure is bad! No network requests
  11. 7:41Don't interact with services from test environment
  12. 8:33Time to stub!
  13. 9:04Built-in Stubbing Typhoeus Faraday Excon
  14. 20:03Even Better Record API automatically Replay responses without network Verify responses
  15. 20:48Additional Build Process Runs outside normal test mode Rechecks cassettes for diffs Avoids versioning issues
  16. 25:06Bringing it all together Testing services is crucial If in doubt, stub it out Determine the flexibility you want Record responses to save time
  17. 26:11Next Up Eliminating Inconsistent Test Failures with Austin Putman
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.