Summary
The live integration tests exercise the typed Rust client library. The CLI (crates/clickhousectl/) is a thin wrapper over that library, so most regressions caught by cargo build cover both. But the CLI also assembles request bodies from clap-parsed args and prints responses — that assembly logic isn't tested today.
This issue is scoping work: figure out what contract coverage looks like and what it would catch.
Questions to answer
- What classes of bug would slip through
cargo build + library integration tests but be caught by CLI-level tests? Candidates:
- CLI builds a request body that drops a required field.
- CLI's
--flag to API field mapping silently desyncs from the library's expected request shape.
- CLI's JSON output mode doesn't round-trip through the library types (regression in
Display vs serde).
- Should this be assertion-on-snapshot (the CLI invocation produces an expected wire request), wiremock-driven (CLI hits a local mock, assert the request), or both?
- Where does this live —
crates/clickhousectl/tests/ (new), or extend client_test.rs to assert request shape only?
Out of scope
- Implementing the coverage. This issue produces a proposal + a sub-issue or two with concrete scope.
Notes
- This was raised in the context of why we don't path-filter live tests. The argument was: if CLI-only PRs run no live tests, we need some coverage that catches a broken contract. Until contract tests exist, we run live everywhere.
Parent: #151
Summary
The live integration tests exercise the typed Rust client library. The CLI (
crates/clickhousectl/) is a thin wrapper over that library, so most regressions caught bycargo buildcover both. But the CLI also assembles request bodies from clap-parsed args and prints responses — that assembly logic isn't tested today.This issue is scoping work: figure out what contract coverage looks like and what it would catch.
Questions to answer
cargo build+ library integration tests but be caught by CLI-level tests? Candidates:--flagto API field mapping silently desyncs from the library's expected request shape.Displayvs serde).crates/clickhousectl/tests/(new), or extendclient_test.rsto assert request shape only?Out of scope
Notes
Parent: #151