Cover instance_private_endpoint_create + config_get#175
Open
sdairs wants to merge 1 commit into
Open
Conversation
Add a "Private Endpoints" phase to the service CRUD integration test that exercises both endpoints against the live service: - `instance_private_endpoint_config_get` runs twice (before and after the create attempt) and asserts the response contains non-empty endpointServiceId and privateDnsHostname. - `instance_private_endpoint_create` is called with a provider-shaped but synthetic id derived from `ctx.run_id`. The control plane validates the id against the underlying provider, so a synthetic value is expected to be rejected with a structured 4xx. The step asserts either success (followed by inline cleanup via `instance_update` `privateEndpointIds.remove`) or a 4xx with a non-empty error message — anything else, including 5xx or malformed payloads, is recorded as a failure. This is the assertion-on-error fallback called out in #160. All steps are NonBlocking so the rest of the lifecycle can still run. Closes #160 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e23a0c0 to
ea8cb2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Private Endpoints phase to
tests/integration_test.rscovering the two service-scoped private endpoint methods that previously had no live coverage:instance_private_endpoint_config_get— runs twice (before and after the create attempt) and asserts the response contains non-emptyendpointServiceIdandprivateDnsHostname.instance_private_endpoint_create— called with a provider-shaped but synthetic id derived fromctx.run_id.Assertion-on-error fallback (used)
Issue #160 explicitly flagged the risk that synthetic endpoint ids would be rejected by the control plane because no real cloud resource exists behind them. This PR takes that path:
The create step asserts the call either:
instance_updatewithprivateEndpointIds.remove, then re-readsconfig_get), orAny other outcome — 5xx, network error, or 200 with a malformed payload — is treated as a real failure recorded via
FailureRecorder. The synthetic id format is provider-aware (vpce-…for AWS, 19-digit decimal for GCP, GUID for Azure) and embedsctx.run_idso leaked ids in API logs trace back to a specific run. The rationale is documented inline in the test.All new steps are
NonBlockingso the rest of the service CRUD lifecycle (IP access, scaling, delete) still runs even if the API contract for private endpoints shifts.Closes #160
Test plan
cargo build -p clickhouse-cloud-apicargo test -p clickhouse-cloud-api— 86 + 6 tests pass; integration test is#[ignore]and unchanged on the non-ignored path.cargo clippy -p clickhouse-cloud-api -- -D warnings(the invocation CI runs) — clean.cargo clippy -p clickhouse-cloud-api --tests— the only warning underintegration_test.rsis the pre-existingscale_service_and_wait(9/7) function; my code introduces no new lints.🤖 Generated with Claude Code