Skip to main content

Run a manual replay​

View as Markdown
EnterpriseSelf-HostedDedicated

A manual replay runs your recorded test cases whenever you choose, and Keploy answers every outgoing call from the recorded mocks. Each run produces a Test Report.

Choose how to replay​

There are three ways to start a manual replay:

MethodWhere the replay runsUse it to
The dashboardIn your clusterReplay on demand, with nothing to install.
keploy cloud replayOn your machine, in DockerTest a build before you push it, or debug a failure locally.
keploy cloud replay --triggerIn your clusterReplay from a terminal or a CI pipeline without running Docker on that machine.

Replay from the dashboard​

  1. In the sidebar, open Clusters, click your cluster, and stay on the Deployments tab.
  2. Click Replay on the deployment.
  3. Select tests: select test sets, or open a test set and select individual test cases. If you select nothing, every recorded test set runs. Click Next.

Select tests step of the Run Replay dialog

  1. Configure: keep the defaults or change the settings. Click Start Replay.

Configure step of the Run Replay dialog

The deployment row now shows Replaying with the progress. Click it to see live counts, open the replay page with View details, or cancel the run with Stop Replay.

To replay a selection from the Recordings page, select the test cases and choose Replay → Replay in cluster.

Test cases that auto-replay already marked as failed aren't listed, and the replay skips them. A replay from the dashboard always runs against main.

Replay settings​

SettingDefaultWhat it does
Initial delay (seconds)10How long Keploy waits for your app to start in the replay pod before sending tests. If the app is still not accepting connections, Keploy waits longer.
API timeout (seconds)10Timeout for each test request. An empty field means 10 seconds.
Strict mock noiseOffFails an outgoing call when a value in its request body changed since recording. See Strict mock noise.
Freeze timeOnReplays with the clock set to the recording time. See Time Freezing.
Replay image (optional)The deployment's imageContainer image for the replay pod. Use it to test a new build against the recorded traffic.
Environment variablesNoneExtra environment variables for your app during replay.
Advanced optionsNoneResponse fields to ignore in this run. See Ignore fields in a run.
Debug LogsOffTurns on debug logging in the replay pod.

The dialog fills in the settings from your previous replay of the same deployment. Check them before you start a new run.

Ignore fields in a run​

Some response fields change on every run, such as a timestamp, a request ID or a token. Keploy calls them noise and ignores them when it compares responses. To ignore fields in one run, enter them under Advanced options:

FieldExample
Global noise: body fieldsdata.timestamp
Global noise: headersDate
Per test-set noise: bodytest-set-1: data.sessionId
Per test-set noise: headerstest-set-1: Date

Separate multiple entries with commas or new lines. These fields apply to this run only. To ignore a field in every run, add it to the test case instead; see Edit test cases and mocks.

Strict mock noise​

Strict mock noise decides how closely an outgoing call's request body must match a recorded mock. It is off by default. In the API and in older configurations, it is called schemaNoiseStrict, which is the same setting as mockNoiseStrict.

  • Off: an outgoing call matches a mock by the shape of its JSON request body. Values are compared only on mocks that already have learned noise.
  • On: every changed value in the request body must be known noise, or Keploy rejects the mock. If no mock is left, the call isn't served and the test fails.

Use strict mode when a changed request value would be a real bug, such as a wrong amount sent to a payment service. Before you turn it on, run a few auto-replay rounds with mock noise detection on, so that Keploy has already learned the fields that are expected to change. Strict mock noise has no effect on auto-replay.

Replay on your machine​

keploy cloud replay downloads the recorded test cases and mocks, and runs your app and the tests in Docker on your machine. You need the Keploy CLI and Docker.

On the deployment row in the dashboard, click the terminal icon (Cloud replay command) to copy a ready-made command:

keploy cloud replay --app "<namespace>.<deployment>" --cluster "<cluster>"
  • By default, the replay runs the image of the recorded deployment. To test another build, add --image <image>:<tag>.
  • To replay only some test sets, add --test-sets.
  • To replay a Keploy branch, add --branch-name <branch>.

When the run ends, the CLI prints a link to its Test Report.

Replay in the cluster from the CLI​

Add --trigger to start the replay in your cluster instead of on your machine. It runs as a replay from the dashboard does, so the machine that runs the command doesn't need Docker:

keploy cloud replay --app "<namespace>.<deployment>" --cluster "<cluster>" --trigger
  • --trigger replays all recorded test sets, so it can't be combined with --test-sets.
  • --image works as it does on your machine. The cluster must be able to pull the image.
  • --branch-name replays a Keploy branch in the cluster. This needs a recent k8s-proxy; an older one refuses the run and says so.
  • The CLI prints the progress while the replay runs. Find the Test Report under Reports in the dashboard.

In a pull-request pipeline, both CLI methods also manage a Keploy branch for the pull request. See Replay in CI.

For every flag, see the Cloud Replay Command Reference.

Open the Test Report​

  1. In the sidebar, open Reports. On Live recording runs, the Recordings tab lists your manual replays.

Test Reports list with manual runs

  1. Click a run. The Test Report page shows Total, Passed, Failed, Ignored, Duration and Run by. Click a test to see its request, response and noise.

Test Report page with a test&#39;s request and response

If any test failed, see Fix failing tests.