test(smoke): mocked critical-path gate that runs keyless on every PR#226
Open
jhamon wants to merge 1 commit into
Open
test(smoke): mocked critical-path gate that runs keyless on every PR#226jhamon wants to merge 1 commit into
jhamon wants to merge 1 commit into
Conversation
Replicates the Python SDK's key-free mocked smoke gate (PIN-75 §2) in the Java SDK. Adds src/smoke/java/io/pinecone/smoke/MockedCriticalPathTest.java exercising the real connect -> upsert -> query plumbing against in-process mocks: - Control plane (describeIndex): OkHttp MockWebServer pointed at via Pinecone.Builder.withHost() — real REST request/response path. - Data plane (upsert / query): in-process grpc.Server from grpc-testing implementing VectorServiceGrpc.VectorServiceImplBase; channel injected via PineconeConfig.setCustomManagedChannel -> PineconeConnection -> Index. Real gRPC proto marshaling/unmarshaling runs end to end. Adds a `smokeTest` Gradle task in build.gradle (new `smokeTest` sourceSet extending testImplementation) and a `Smoke (mocked, no key)` job in pr.yml that runs with no PINECONE_API_KEY. The task throws GradleException if zero tests run so an accidentally emptied suite fails the job rather than silently passing. Test verified locally: PASSED. Java SDK is 3rd in the PIN-77 rollout sequence (TS→Go→Java→Rust): - TS done: pinecone-ts-client#395 - Go done: go-pinecone#150 Refs PIN-77. 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
Propagates the Python SDK's key-free mocked critical-path smoke gate (PIN-75 §2) to the Java SDK. This is the 3rd entry in the PIN-77 rollout (TS → Go → Java → Rust); TS is pinecone-ts-client#395 and Go is go-pinecone#150.
Why
The keyed integration suites (
src/integration) can't run on forks or unkeyed PRs, so a regression in the core request/response plumbing can land unnoticed. This gate exercises the real connect → upsert → query path on every PR with no API key.How
src/smoke/java/io/pinecone/smoke/MockedCriticalPathTest.java— drivesPinecone.Builder→describeIndex→PineconeConnection+Index→upsert+querywith fully in-process mocks:describeIndex): OkHttpMockWebServerpointed at viaBuilder.withHost(...). Real REST request/response path.upsert/query): in-processgrpc.Serverfromio.grpc:grpc-testingimplementingVectorServiceGrpc.VectorServiceImplBase; channel injected viaPineconeConfig.setCustomManagedChannel→PineconeConnection→Index. Real gRPC proto marshaling/unmarshaling runs end to end.build.gradle— newsmokeTestsourceSet (extendstestImplementation) +smokeTestGradle task with a zero-collection guard (throwsGradleExceptioniftestCount == 0)..github/workflows/pr.yml— newSmoke (mocked, no key)job that runs with noPINECONE_API_KEYon every PR and push to main.src/smoke/README.md— documents mocking strategy, local run command, zero-collection guard.Verification
Refs PIN-77.
🤖 Generated with Claude Code
Note
Low Risk
Changes are limited to smoke tests, Gradle wiring, and CI; production SDK code is unchanged.
Overview
Adds a key-free PR smoke gate that exercises connect → upsert → query without
PINECONE_API_KEY, so forks and unkeyed PRs still catch regressions in request/response plumbing before keyed integration tests run.MockedCriticalPathTestdrives the real SDK path with transport-layer mocks: OkHttpMockWebServer+Pinecone.Builder.withHost(...)fordescribeIndex, and an in-processVectorServiceGrpcserver with the channel injected viaPineconeConfig.setCustomManagedChannelforupsert/query. Assertions cover responses and on-wire request fields (namespace, topK, vectors).Build/CI: new
smokeTestsource set and Gradle task (fails if zero tests run), plus aSmoke (mocked, no key)workflow job on every PR/push tomain.src/smoke/README.mddocuments how to run locally and how this relates to keyedsrc/integrationtests.Reviewed by Cursor Bugbot for commit d95ad80. Bugbot is set up for automated code reviews on this repo. Configure here.