test(server): RPC-iterating drift guard for the gRPC surface (done-bar §4)#48
Merged
Merged
Conversation
…r §4)
Add TestGRPCSurface_EveryRPCHasRoundTripTest — the registry-iterating done-bar
guard (rule 18) for the provisioner gRPC surface. It iterates the proto-generated
ProvisionerService_ServiceDesc.Methods (single source of truth for which RPCs
exist) and fails CI if any RPC lacks a maintained, existing real-backend
round-trip test.
Closes the silent-untested-RPC class: today's round-trip suite proves
ProvisionResource/DeprovisionResource/GetStorageBytes/RegradeResource are
exercised end-to-end, but adding a new RPC to the proto would not red that suite —
it would ship with zero real-backend coverage, silently. This guard reds on:
- a new RPC with no rpcCoverage entry (unmapped),
- a mapping pointing at a deleted/renamed test (source-parsed, so the name
must really exist), or
- a stale mapping/exemption for an RPC removed from the proto.
Pure descriptor + source-scan test: no backends, no env, never skips — runs
unconditionally in the `go test -short` deploy gate, as a drift guard must.
Exemptions require both an exemptedRPCs entry and a justification row in
INTEGRATION-COVERAGE-EXCLUSIONS.md (none today).
All 4 RPCs already have real round-trip tests; this test only guards against
future drift. make gate green; failing-then-passing verified (dropping a mapping
or renaming a mapped test reds it).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds
TestGRPCSurface_EveryRPCHasRoundTripTest(internal/server/server_rpc_coverage_guard_test.go) — the registry/RPC-iterating done-bar guard (rule 18) for the provisioner gRPC surface, per docs/sessions/2026-06-04/USER-FLOW-INVENTORY-AND-TEST-MATRIX.md §4.It iterates the proto-generated
ProvisionerService_ServiceDesc.Methods(the single source of truth for which RPCs exist) and fails CI if any RPC lacks a maintained, existing real-backend round-trip test.Why
Integration coverage is already strong (
internal/server99.2% after #47), and all four RPCs —ProvisionResource,DeprovisionResource,GetStorageBytes,RegradeResource— have real round-trip tests. But that's a snapshot: adding a new RPC toproto/provisioner/v1/provisioner.protowould not red the round-trip suite, so it could ship with zero real-backend coverage, silently (the silent-untested-RPC class).This guard closes that hole. It reds on:
rpcCoverageentry (unmapped),go/ast, so a mapped name must actually exist), orDesign
Pure descriptor + source-scan test — no backends, no env, never skips. It runs unconditionally in the
go test -shortdeploy gate (a drift guard that can skip is useless). Does not touch the NATS-via-docker-run coverage workflow.Exemptions require both an
exemptedRPCsentry and a justification row inINTEGRATION-COVERAGE-EXCLUSIONS.md(none today — every RPC has a real round-trip).Verification
ProvisionResource,DeprovisionResource,GetStorageBytes,RegradeResource— all four mapped to existing round-trip tests.RegradeResourcemapping reds with "exists in ServiceDesc but has NO entry in rpcCoverage"; renaming a mapped test to a nonexistent name reds with "no such test function exists"; restore passes.make gateGREEN.golangci-lint runon the new file: 0 issues.🤖 Generated with Claude Code