Skip to content

Close live API integration test coverage gap #151

@sdairs

Description

@sdairs

Summary

The Rust client at crates/clickhouse-cloud-api/ exposes 100 async methods. The live integration tests in tests/integration_test.rs (service CRUD) and tests/integration_postgres_test.rs (postgres CRUD) exercise 25 of them. The other 75 are mock-tested in tests/client_test.rs only, which catches request-shape regressions but not live API drift.

The mock tests + scripts/check-openapi-drift.py will tell us when the spec moves. They won't tell us when a method that compiles locally returns 4xx in production. As clickhousectl ships more cloud commands, this gap turns into runtime errors for end users.

This issue groups the work to close that gap.

Strategy

  • Three test binaries, one per resource shape:
    • integration_org_test.rs (new) — org-scoped endpoints, no service provisioning.
    • integration_test.rs (extend) — endpoints needing one ClickHouse service.
    • integration_postgres_test.rs (extend) — endpoints needing one Postgres service.
  • Each binary = one #[tokio::test] lifecycle with FailureRecorder accumulating non-blocking failures so a single run reports every broken endpoint, not just the first.
  • Always run all three on every PR. Path-based selection deferred.
  • Failure policy: NonBlocking by default; Blocking only when downstream phases depend on the step.

Scope

Bootstrap

Org suite (depends on #152)

Service suite (extends integration_test.rs)

Postgres suite (extends integration_postgres_test.rs)

Separate

Out of scope this round

Fixtures required

  • Existing second user in the test org (already present).
  • New env var CLICKHOUSE_CLOUD_TEST_SECONDARY_USER_ID — that user's id.
  • Invitations sent to alasdair.brown+clickhousectl_{run_id}@clickhouse.com (catch-all alias, cancelled before accept).

Today's coverage

25/100 client methods covered live. The remaining gap is enumerated across the linked child issues; closing every in-scope issue brings live coverage to 35 of the 100 methods, with the other 65 categorised under "Out of scope this round" above.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttest-coverageLive API integration test coverage work

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions