Keep useful API cases with every change.
Carry reviewed API inputs and a clear application assertion from a local fix into review and your existing CI suite. A teammate or runner can exercise the same condition without waiting for the shared sandbox to fail.
Catch a regression when a read dependency stays unavailable
Handle activity lookup failures#184
fix/activity-retriesmainChecks503 · reviewed fixture4 / 3 attemptsexpect(attempts).toHaveLength(3)Received 4Inspect attempt log
Attempt 1503Attempt 2503Attempt 3503Attempt 4503Beyond limit
When to use it
A fixture needs enough context to survive the handoff.
Choose a stable API case that protects an outcome customers depend on. Start with one assertion your existing runner can explain, such as the maximum attempt count after a dependency stays unavailable.
What to check
- Reviewed case
- A read dependency returns HTTP 503 for every application attempt.
- Runner preflight
- The runner confirms the expected status, body and response source before testing the client.
- Application check
- The check fails if it observes four attempts where the client is expected to stop at three and report a terminal error.
How to approach it
Run regression checks in CI
4 steps
- API fixtures
- Git
- Your CI runner
Version the case with the assertion it protects
Store the reviewed inputs, route configuration, starting state and expected result. Keep raw capture data and credentials out of the repository. A prepared synthetic service model needs its own review, compile, apply and import steps before the runner uses its fixtures.
Prepare an isolated run
Use a supported stack with pinned versions. Wait for setup, load the library and explicitly select MOCK. Reset the application database or caches independently, and give concurrent jobs separate mutable test state.
Verify that the dependency is ready
Send one known request and check status, body and response source. Check separately for unintended upstream requests. Report a failed preflight as a setup or fixture problem so it stays distinguishable from a failing application assertion.
Run the test command and retain the evidence
Use your existing test runner to assert the attempt limit and terminal error. Preserve the case version, preflight result and failing request or assertion before teardown. Review fixture updates as deliberately as code changes.
What this gets you
Give every reviewer the same starting point
A reviewed API case, its matching service setup and a three-attempt limit are available to the next developer, reviewer and CI run.
What the check tells you
A passing run covers the selected requests and client assertions. Maintain separate live checks where you need the upstream’s current contract, credentials or network behavior.
Where Gostly fits
Your team supplies stack setup, routing and assertions. Compile and apply code models before importing their fixtures. Keep live integration checks separate and review data before sharing or exporting it.
Put it into practice
- DocsConfigure your CI runnerSet up a reviewed library, route the client and preflight it before your existing command.
- DocsChoose the retry assertionsCheck recovery and exhaustion without treating every failed response as safe to retry.
- ProductSee a second CI use caseSee how repeatable inputs support review and deployment checks.
More worked examples
Compare sample API conditions with the checks your application can run.
Keep CI running without a live sandbox
Authored worked example · synthetic data
A known ready-order response while the sandbox is unavailable
The authored baseline is a ready USD order with an integer amount. Three controls show what this declared consumer accepts or refuses; they are local response checks rather than a completed CI run.
| Your action | API condition | Your test checks |
|---|---|---|
| Inspect the baseline | 200; matching order; amount_minor 4200; USD; ready | Accept under usd-ready-order-v1; add the application assertion separately |
| Add an optional trace field | The baseline also contains trace_id | Accept because the consumer permits unrelated fields |
| Change the amount to a string | amount_minor is the string 4200 | Refuse because the consumer requires a non-negative safe integer |
| Change USD to EUR | The JSON shape stays the same while the currency changes | Refuse under this consumer's USD-only rule, not a universal currency rule |
This is a workflow for the complete self-hosted stack. Plan for its runner resources, startup, license checks and configured operational connections.
CI integration setupGive new engineers a useful API to learn against
Authored worked example · synthetic data
A first change to the order history screen
Use synthetic order examples for a populated list, an empty list and an unavailable dependency. The task is to make each screen state useful, then explain which API condition drives it.
| Your action | API condition | Your test checks |
|---|---|---|
| Install and check the prepared service | The library is ready in MOCK mode | Confirm the client request reaches the reviewed example |
| Open a populated order history | A synthetic list of orders is returned | Display the expected rows without a production account |
| Use the empty and failure cases | Each selected example supplies its intended condition | Check the empty state and useful error message |
| Review the first change | The same library supports the reviewer’s local run | Explain the covered cases and what still needs a live check |
A recording is not automatically safe onboarding data. Credential headers, local replay bodies, processed library data and imported files have different handling rules; review the material you share.
Follow the quick startYour next change