~/talk

Testing Against AWS APIs

Talkat GopherCon 2019 · 2019-07-24..07-27· [testing, go]
links:none on file
slides:none on file

Code uses Go and the AWS SDK to call EC2 DescribeInstances; goal is deterministic tests without hitting live AWS. Refactor functions to accept the generated ec2 API interface (eg ec2iface.EC2API) instead of a session, implement a small mock client that returns crafted DescribeInstancesOutput populated with specific instance IDs, and run table-driven tests that assert exact results. The mock carries an instanceIDs field so tests control returned values; the approach compiles and reproduces expected outputs.

AI-written summary · about

  1. 0:00Intro
  2. 0:25Writing code that interacts with AWS
  3. 0:38Testing code against live systems
  4. 1:37EC2 API
  5. 1:56AWS API Patterns
  6. 2:32API Documentation
  7. 2:51API Testing
  8. 3:15Special Sauce
  9. 3:38API Clients
  10. 4:28Test Code
  11. 4:46Mock Client
  12. 5:36Test
  13. 5:48Live Demo
~/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.