Skip to content

test(smoke): mocked critical-path gate that runs keyless on every PR#226

Open
jhamon wants to merge 1 commit into
mainfrom
pin-81-java-mocked-smoke-gate
Open

test(smoke): mocked critical-path gate that runs keyless on every PR#226
jhamon wants to merge 1 commit into
mainfrom
pin-81-java-mocked-smoke-gate

Conversation

@jhamon

@jhamon jhamon commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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 — drives Pinecone.BuilderdescribeIndexPineconeConnection + Indexupsert + query with fully in-process mocks:
    • Control plane (describeIndex): OkHttp MockWebServer pointed at via Builder.withHost(...). Real REST request/response path.
    • Data plane (upsert/query): in-process grpc.Server from io.grpc:grpc-testing implementing VectorServiceGrpc.VectorServiceImplBase; channel injected via PineconeConfig.setCustomManagedChannelPineconeConnectionIndex. Real gRPC proto marshaling/unmarshaling runs end to end.
  • build.gradle — new smokeTest sourceSet (extends testImplementation) + smokeTest Gradle task with a zero-collection guard (throws GradleException if testCount == 0).
  • .github/workflows/pr.yml — new Smoke (mocked, no key) job that runs with no PINECONE_API_KEY on every PR and push to main.
  • src/smoke/README.md — documents mocking strategy, local run command, zero-collection guard.

Verification

$ ./gradlew smokeTest
MockedCriticalPathTest > testConnectUpsertQueryAgainstMockedBackend() PASSED
Results: SUCCESS (1 tests, 1 passed, 0 failed, 0 skipped)
# No PINECONE_API_KEY set.

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.

MockedCriticalPathTest drives the real SDK path with transport-layer mocks: OkHttp MockWebServer + Pinecone.Builder.withHost(...) for describeIndex, and an in-process VectorServiceGrpc server with the channel injected via PineconeConfig.setCustomManagedChannel for upsert/query. Assertions cover responses and on-wire request fields (namespace, topK, vectors).

Build/CI: new smokeTest source set and Gradle task (fails if zero tests run), plus a Smoke (mocked, no key) workflow job on every PR/push to main. src/smoke/README.md documents how to run locally and how this relates to keyed src/integration tests.

Reviewed by Cursor Bugbot for commit d95ad80. Bugbot is set up for automated code reviews on this repo. Configure here.

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>
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.

1 participant