Keploy as a ClickHouse testing framework
Keploy mocks ClickHouse by recording its protocol beneath your driver, capturing the exact aggregate rows and column types your queries returned, then replaying them during tests. No cluster runs in CI and no table has to be populated to test an aggregation.
keploy record -c "./analytics-service"What Keploy gives a ClickHouse team
Captured at the ClickHouse protocol
Keploy records the native or HTTP protocol beneath your driver, so an aggregation replays with the rows the server computed and the column types it declared.
- Below clickhouse-go, clickhouse-driver, and the JDBC driver
- Column types and codecs preserved
- Native and HTTP interfaces
- Aggregate results captured verbatim
Why ClickHouse integration tests slow teams down
The friction is rarely the assertions. It is everything around them — spinning up dependencies, keeping mocks honest, and repairing tests after every refactor.
Testing ClickHouse: by hand, with Testcontainers ClickHouse, or with Keploy
A real instance computes the aggregate correctly and needs data inserted to do it. Keploy records the computed result once and replays it with no cluster and no seeding.
Select any row for the full comparison, with code.
What you write for ClickHouse vs what Keploy records
All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.
A wrong GROUP BY key or a missing date filter returns these buckets unchanged, so the query under test is the one thing this cannot verify.
Real aggregation semantics — and fifty thousand inserted rows plus a container boot before a single assertion runs.
The buckets are what ClickHouse computed over the real dataset, so replay asserts on a genuine aggregate without inserting a single row.
Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.
ClickHouse testing tools, compared
The options a team on relational databases actually reaches for, and where each one genuinely wins. Select a row for the full comparison.
Assessments reflect each tool’s documented behaviour, not benchmark measurements.
Record your ClickHouse app once, replay it forever
Keploy sits below your ClickHouse process at the network layer. It watches the calls your app already makes, then serves them back on replay so tests run with no dependencies attached.
Keploy records a GET call to /api/v1/orders/{id} on a ClickHouse service and captures the dependency calls it makes.
ClickHouse clients Keploy records, driver by driver
Keploy captures ClickHouse at the wire protocol, so 5 of these 6 clients need no adapter, no test double, and no ClickHouse instance in CI.
- Auto-mocked
GoView page
clickhouse-go
- Auto-mocked
PythonView page
clickhouse-driver and clickhouse-connect
- Auto-mocked
JavaView page
the ClickHouse JDBC driver
- Auto-mocked
Node.jsView page
@clickhouse/client
- Partial
Apache KafkaView page
The Kafka table engine's ingest traffic
- Outbound HTTPAuto-mocked
Outbound HTTP
Any HTTP client call the service makes
Your first ClickHouse test suite in under five minutes
Every command below runs against your existing ClickHouse service. Nothing in your source tree changes.
1Install the Keploy CLI
A single binary. It needs a Linux kernel with eBPF support, or Docker on macOS and Windows — and it adds nothing to your project's dependencies.
curl -sSL https://keploy.io/install.sh | bash2Record your service
Pass the command you already use to start the app. Keploy runs it and watches every socket it opens.
keploy record -c "./analytics-service"3Exercise the paths you care about
Run the app against your development ClickHouse. Every query and the aggregate it computed are captured together.
curl 'localhost:8080/analytics/orders-by-state?day=2026-09-01'curl 'localhost:8080/analytics/revenue?window=7d'4Replay in CI
Replay serves the recorded dependency responses, so the job needs no service containers and no Docker daemon.
keploy test -c "./analytics-service" --delay 8
Ready to try it on your own ClickHouse service?
Works with the rest of your ClickHouse stack
Keploy records at the network layer, so framework and driver choices inside your ClickHouse app do not change how it captures traffic.
Go
clickhouse-go traffic records at the protocol layer.
Python
clickhouse-connect records identically.
PostgreSQL
The transactional page covers its protocol in depth.
Apache Kafka
Kafka-engine ingest appears as broker traffic.
Java
The JDBC driver records without a wrapper.
Docker
Record in a container or on the host; replay needs neither.
Testing the rest of your stack
- Databases
Keploy as a PostgreSQL testing framework
Record the Postgres frontend/backend protocol once and replay real result sets in tests — no container, no pg-mem, no schema to rebuild.
Read the guide - Databases
Keploy as a MySQL testing framework
Mock MySQL at the wire protocol instead of standing up a container or swapping in H2 — the rows your queries really returned, replayed.
Read the guide - Message Queues
Keploy as a Apache Kafka testing framework
Test producers and consumers against recorded broker exchanges — no embedded Kafka, no Testcontainers cluster, no flaky poll loops.
Read the guide - Languages
Keploy as a Go testing framework
Record a running Go binary once and get table-test-grade coverage with sqlmock-free database stubs and no httptest servers to maintain.
Read the guide - Languages
Keploy as a Python testing framework
Turn the requests your Python service already handles into a pytest-grade regression suite, with every dependency mocked from the recording.
Read the guide - Languages
Keploy as a Java testing framework
Generate JUnit-grade integration tests for any JVM service by recording the traffic it already serves.
Read the guide
Join our GlobalCommunity
Connect with developers worldwide. Follow updates, ask questions, share feedback, and ship faster with other Keploy builders.
“Best report of integration and API tests I've seen — which we don't get from RestAssured.”
G2“Future of microservices testing. I don't write tests now!”
G2 · 5/5“An amazing product that simplifies the automation.”
Gartner · 4.0