AI-Native CI/CD · API testing in CI

Catch API regressions before they merge.

Mock the APIs your tests call in CI with reviewed responses built from real API traffic, and add controlled failures. See how an AI-assisted patch handles the cases that matter before you approve it.

14-day Pro trial. Runs on Docker Compose in your environment. See pricing

  • Self-hosted
  • Runs on Docker Compose
  • Built from real API traffic
  • Your test data, your control
  • Use the tests you already run

papertrail storefront

Private repository

Pull requests #128

Deduplicate refund credits

Open

fix/refund-dedupemain

Checks Billing integrationOriginal patch

Refund redelivery

Failed · 2 credits recorded

expect(credits).toHaveLength(1)
Customer store credit
$48.00
Expected
$24.00

Webhook deliveries

Redelivery details

Refund event
evt_refund_1042
Dedupe key
delivery_02

The delivery ID changed. The original patch adds a second credit.

Deduplicate by refund event

handle-refund.ts
− const key = delivery.id+ const key = refund.eventId

What the check protects

One refund should credit the customer once.

A happy-path test sends one event. This check sends the same refund again with a different delivery ID. The first patch processes both deliveries. The guarded patch recognizes the logical event and records one credit.

Hold steady
The refund event, delivery sequence and starting account balance.
Check the side effect
Expect one credit after redelivery. Add a distinct valid event as a control.
Keep the case
Put the reviewed input and application assertion beside the code change.

From a reproduction to a required check

Put the hard cases in the path to merge.

Gostly supplies the API dependency environment. Your runner executes the tests, and your team chooses which checks must pass.

  1. 01

    Prepare the API case

    Record permitted traffic or author the response your test needs. Review the fixture and confirm which requests it covers.

  2. 02

    Run your existing suite

    Start the supported stack in your runner, load the reviewed library and route the client through Gostly. Let your tests exercise the same case against the new code.

  3. 03

    Review the observed behavior

    Assert the outcome customers depend on and confirm which response the client received. Keep separate live checks for the provider behavior that needs them.

Flaky tests · Continuous integration testing

Take the shared sandbox out of your flaky tests.

An integration test turns flaky when the API behind it changes between runs: a sandbox another team reset, a rate limit another pipeline used up, a vendor environment that is down for an hour. Serve those calls from a reviewed library and the test meets the same API responses on every run.

Same answers each run
In MOCK mode Gostly answers from the reviewed library and does not call the upstream API.
Hermetic tests
For the services you route through Gostly, a continuous integration run reaches no live external API.
What stays yours to fix
Flakiness from timing, test order or the browser has other causes and needs its own fix.

FAQ

Where does AI fit?

Gostly gives tests around AI-assisted code a controlled API environment. It does not write your delivery workflow or approve a change. Your test runner and release decisions stay yours.

Can I use my existing CI system?

Use a runner that supports the complete self-hosted Gostly stack and its normal dependencies. Bring a reviewed response library, matching service configuration and your existing tests.

What if the vendor’s sandbox is down?

In MOCK mode Gostly answers from the reviewed library and does not call the upstream API, so the run does not wait on the sandbox.

Will this fix my flaky tests?

It removes one cause: an API dependency that answers differently from one run to the next. Tests that fail on timing, test order or UI rendering have other causes.

What if a request is not covered?

Make expected status, body and response origin part of acceptance. Your suite should flag missing coverage instead of treating an unrelated response as success.

Does this replace live-provider testing?

Keep live checks for current contracts, credentials and behavior that needs the provider. Reviewed matches cover selected API questions; they do not make every connection local.

How does the trial work?

Every new account starts a 14-day Pro trial automatically, with no credit card required. A subscription is required after the trial.

Resources

Take the next step

Choose a failure to exercise

Put errors, slow responses and rejected requests into the cases your tests already cover.

Explore failure injection

Turn an API failure into a CI check

Follow a worked case from the failing assertion to the corrected app behavior.

Work through the guide

Carry cases from development into CI

Keep the API situation behind a fix available for the next change.

Explore the solution

Keep the case that caught the bug.

Start with one API dependency and the assertion your next release should preserve.