Skip to main content

Developer guide​

View as Markdown
EnterpriseSelf-HostedDedicated

Keploy turns real traffic to your Kubernetes deployments into tests. It records each request your app receives as a test case, and each call your app makes to a database or another service as a mock. It then replays those test cases against your app, with the mocks standing in for its dependencies, to catch regressions.

This guide covers the developer workflow, from connecting a cluster to keeping your tests up to date.

Recordings page for an app recorded with Keploy

Workflow​

  1. Set up: Connect your cluster to Keploy and install the CLI. You do this once.
  2. Record: Capture live traffic on a deployment.
  3. Check coverage: See which parts of your API your tests cover, and what to record next.
  4. Auto-replay: Replay newly captured test cases automatically while a recording runs.
  5. Manual replay: Replay test cases on demand and review the results in a Test Report.
  6. Fix failing tests: Fix the code when your app regressed, or delete obsolete test cases on a branch and merge it into main.
  7. Edit test cases and mocks: Change recorded test cases and mocks, and mark fields that change on every run as noise.
  8. Replay in CI: Replay every pull request, and let Keploy manage a branch for the tests a pull request changes on purpose.

Key terms​

TermMeaning
Test caseOne recorded request to your app and the response it returned.
MockOne recorded outgoing call your app made, such as a database query or an HTTP call. During replay, Keploy answers from it.
Test setA group of test cases, with their mocks, from a recording. A recording produces one or more test sets.
Smart test setThe app's long-lived, deduplicated set of recorded flows, used for regression testing.
NoiseA field Keploy ignores when comparing, because its value changes on every run, such as a timestamp, an ID or a token.
Test ReportThe result of a manual replay: which test cases passed and failed, with a diff for each failure.
BranchA place for test-data changes, such as deletes and edits, that reach main only after they are committed, reviewed and merged.

Permissions you need​

TaskPermissionBuilt-in roles that have it
Recordrecord:start on the cluster, or testcase:write on the appAdmin, App Admin, Cluster Admin
Replayreplay:start on the cluster or the appAdmin, App Admin, Cluster Admin
Change test data on a branch, and merge itbranch:write and branch:merge on the appAdmin, App Admin

If a button is disabled or you see a permission error, ask your admin for the role you need.