Skip to content

Add ClickHouse settings round-trip to service integration test#176

Open
sdairs wants to merge 2 commits into
md/add-clickpipes-supportfrom
issue-161-clickhouse-settings-roundtrip
Open

Add ClickHouse settings round-trip to service integration test#176
sdairs wants to merge 2 commits into
md/add-clickpipes-supportfrom
issue-161-clickhouse-settings-roundtrip

Conversation

@sdairs
Copy link
Copy Markdown
Collaborator

@sdairs sdairs commented May 15, 2026

Summary

Adds a new ClickHouse Settings phase to cloud_service_crud_lifecycle in crates/clickhouse-cloud-api/tests/integration_test.rs, taking the four uncovered settings endpoints (service_clickhouse_settings_schema_get, service_clickhouse_settings_list_get, service_clickhouse_settings_update, service_clickhouse_setting_get) from mock-only to live coverage.

  • Fetches the schema, picks the first setting from a curated no-restart-required allowlist that actually appears in the live schema (max_concurrent_queries_for_user, then max_threads, max_memory_usage_for_user, min_insert_block_size_rows), captures the current value via the list endpoint, updates to a different benign integer value, and polls the per-setting GET until the change is visible.
  • All four steps are NonBlocking via FailureRecorder, so a single regression on one of these endpoints does not mask others.
  • Restoration is implemented as a new cleanup-registry hook (register_clickhouse_setting_restore) so the original value is reapplied unconditionally after the test body completes, before the service is deleted. The cleanup tolerates 404 if the service was already deleted.
  • The schema endpoint does not carry a restartRequired marker, so the candidate list is hardcoded with a comment explaining the choice — the setting is still discovered at runtime by intersecting the allowlist with the live schema.

Closes #161

Test plan

  • cargo build -p clickhouse-cloud-api
  • cargo clippy -p clickhouse-cloud-api --tests -- -D warnings — passes for new code. Two pre-existing lint errors on main remain unchanged (6× collapsible_if in spec_coverage_test.rs, 1× too_many_arguments on scale_service_and_wait). Verified by stashing changes and re-running clippy.
  • cargo test -p clickhouse-cloud-api — 86 unit/serde tests + 6 spec-coverage tests pass; the integration test compiles and remains #[ignore] as expected.
  • Live integration run on PR CI (will exercise the new phase end-to-end against production cloud).

🤖 Generated with Claude Code

@sdairs sdairs requested a review from iskakaushik as a code owner May 15, 2026 15:59
@sdairs sdairs had a problem deploying to cloud-integration May 15, 2026 16:00 — with GitHub Actions Failure
@sdairs sdairs temporarily deployed to cloud-integration May 15, 2026 16:53 — with GitHub Actions Inactive
sdairs and others added 2 commits May 16, 2026 12:39
Cover the four ClickHouse settings endpoints
(service_clickhouse_settings_schema_get,
service_clickhouse_settings_list_get,
service_clickhouse_settings_update,
service_clickhouse_setting_get) live by inserting a new "ClickHouse
Settings" phase into cloud_service_crud_lifecycle. The phase fetches the
schema, picks the first setting from a curated allowlist of well-known
no-restart-required runtime knobs, captures its current value, updates
it to a different benign value, polls the per-setting GET endpoint until
the change is visible, and registers a restore on CleanupRegistry so the
original value is reapplied unconditionally after the test body
finishes.

The schema endpoint does not expose a "restartRequired" flag today, so
the candidate list is hardcoded with a comment explaining the
conservative choice; we intersect it with the live schema so we only
mutate a setting the control plane currently advertises.

Closes #161

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The cloud `clickhouseSettings/schema` endpoint exposes a curated subset
of ClickHouse settings, and that subset can change. The test was
recording a NonBlocking failure when none of the four hard-coded
no-restart candidates were present, which aborts the run in fail-fast
mode and erases the coverage the round-trip was meant to add.

Two changes:

1. Expand the no-restart allowlist with additional well-known runtime
   knobs (max_block_size, max_insert_block_size, max_execution_time,
   etc.) so we are more likely to find an intersect with whatever the
   cloud schema currently exposes.

2. Replace the hard failure on empty intersect with a logged skip that
   prints the schema's actual setting names. The schema-get step still
   asserts the endpoint is reachable; the skip gives us the data we
   need to refine the allowlist without breaking the run.
@sdairs sdairs force-pushed the issue-161-clickhouse-settings-roundtrip branch from 9028ae8 to 283fa79 Compare May 16, 2026 11:39
@sdairs sdairs changed the base branch from main to md/add-clickpipes-support May 16, 2026 11:40
@sdairs sdairs temporarily deployed to cloud-integration May 16, 2026 11:40 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover service ClickHouse settings endpoints

1 participant