test(inference): add gRPC provider-create-path coverage for built-in profiles
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 8.7k
- Forks
- 1.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 253
Description
[!IMPORTANT]
Corrections verified againstmain@83284129— see this comment.
The entrypoint named in the Scope section below (ProviderService::create_provider) does not exist; the real functions arecreate_provider_record{,_with_catalog}.
Scope item 2 is also blocked on a visibility change:create_provider_record(pub(super)incrate::grpc) andupsert_inference_route(private incrate::inference) are not visible to any common module.
Context
Follow-up to PR #1704 (merged), per @johntmyers's request.
The new route-resolution tests added in PR #1704 (upsert_cluster_route_* in crates/openshell-server/src/inference.rs) insert Provider records directly via store.put_message. That covers the routing logic but bypasses the public CLI path operators actually use:
openshell provider create --type aws-bedrock --credential ... --config BEDROCK_BASE_URL=...
If a built-in profile (aws-bedrock, deepinfra, nvidia, openai, anthropic, google-vertex-ai) drifts from what the gRPC provider create handler accepts — required vs. optional credential validation, discovery behaviour, defaulting — the existing tests won't catch it.
Scope
Add coverage that goes through openshell_server::grpc::provider::ProviderService::create_provider (or the equivalent public entrypoint) for each built-in profile:
- Positive create path: the documented
provider create --type <profile> ...command shape produces a storedProviderrecord matching whatresolve_provider_routeexpects. - Cluster route end-to-end: chain
create_provider→upsert_cluster_inference_route(withverify: falsefor protocols not yet supported by the validation probe — currentlyaws_bedrock_invoke, but this list is short). - Negative paths: for each profile, the gRPC
create_providerrejects malformed inputs (empty credential map where required, unknown profile type, etc.) with the same error shape the CLI surfaces.
Why this matters
Documentation in docs/sandboxes/manage-providers.mdx and docs/sandboxes/inference-routing.mdx shows specific provider create commands. Today nothing pins those down to behaviour. A test layer one level up from the route-resolution unit tests would catch docs/profile drift before users do.
Related
- PR #1704 — initial Bedrock plumbing; added the route-resolution tests this issue would complement.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with crates/openshell-server/src/inference.rs and the gRPC provider module, then compare the provider-create commands in docs/sandboxes/manage-providers.mdx and docs/sandboxes/inference-routing.mdx with the route-resolution tests from PR #1704. Trace the actual create_provider_record{,_with_catalog} entrypoints and the visibility constraints. Done means coverage for all six built-in profiles, positive and negative creation paths, and the cluster-route chain with the stated verification exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, rust
- Domain
- api, backend-api-design, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100