tomato blog
Notes on testing services from the outside, with tomato.
Presets: Redis the way ElastiCache runs it
A service on ElastiCache with cluster mode and TLS has one Redis client, and a plain Redis container can’t answer it. A tomato preset is a container tomato knows how to run: one line in tomato.yml, and tomato does …
Testing what your service does when the network fails
Databases fail over, caches hang, brokers restart. A test suite on localhost never sees any of it, so the timeouts, retries and fallbacks written for those moments never run until production. tomato’s network …
How tomato tests a web UI
tomato’s browser resource drives a real Chromium the way a person does: it finds fields and buttons by the names people read, waits for the page instead of sleeping, and starts every scenario signed out. Here is …
Databases in a tomato suite: migrations, resets and clean state
tomato empties your databases before every scenario, and there is no switch to turn that off. Why that is the cure for flaky suites, how it fits with migrations, how to keep a table when you must, and how it works for …
Testing a Kafka service that signs in to MSK with IAM
A service that produces to Amazon MSK with IAM has no Kafka password: it trades a web identity token for a role session at STS and signs the handshake with it. Tests usually switch all of that off. tomato runs it: its …
Driving your service: HTTP, gRPC, a browser and a shell
Clients are how a tomato scenario uses your service: through its HTTP API, its gRPC API, its web page in a real browser, or its command line. One idea, four doors.
Mocking third-party dependencies
A stub stands in for a service you don’t run: it answers the way you tell it to, fails when you ask it to, and remembers what your service sent. How tomato’s HTTP, gRPC and WebSocket stubs work, in one …
Testing code that writes to object storage, whichever one you use
S3, Cloudflare R2, DigitalOcean Spaces, Backblaze B2 and Google Cloud Storage all speak the S3 API. So one MinIO container can stand in for any of them in a tomato run, and the service’s code doesn’t change, …
Code coverage for black-box tests, in any language
tomato tests a service from the outside, so it cannot see the code it exercised. The service can: every mainstream language can measure a running process and write the result when it exits. How the approach works, what …