Repository navigation
Add integration tests for future stub - #44
rohanshah18 wants to merge 4 commits into
Conversation
jhamon
left a comment
There was a problem hiding this comment.
I really think we should split up this integration test into many smaller and more focused tests.
| private PineconeIndexOperationClient pinecone; | ||
| private String indexName; | ||
| private static final Logger logger = LoggerFactory.getLogger(PineconeClientLiveIntegTest.class); | ||
| private static final Logger logger = LoggerFactory.getLogger(SyncStubTest.class); |
There was a problem hiding this comment.
Should this be ConfigureIndexTest.class?
| } | ||
|
|
||
| @Test | ||
| public void sanity() throws Exception { |
There was a problem hiding this comment.
I think this test is doing way too much. When a test like this fails, it takes a lot of investigation to figure out what is actually breaking.
Some operations (e.g. create & describe/list, upsert & fetch, upsert & query) make sense to use and test together, but you could still break this down into many smaller test cases.
I would have test cases for:
- Create index (with minimal params) and describe index
- Create index (passing all optional params) and describe index
- Upsert and fetch
- Upsert hybrid and fetch
- Upsert and fetch by id
- Upsert and query by id
- Upsert and query with vector values
- with
includeMetadata - with
includeValues
- with
- Upsert hybrid and query
- Edge cases (missing params, invalid names, wrong vector dimension, etc)
There was a problem hiding this comment.
This is great, thank you for providing me with this list. It has been like this since I picked up and always thought it was okay haha.
| fetchRequest = FetchRequest.newBuilder().addAllIds(ids).setNamespace(namespace).build(); | ||
| fetchResponse = conn.getBlockingStub().fetch(fetchRequest); | ||
| assert (fetchResponse.getVectorsCount() == ids.size() - 1); | ||
| assertEquals (fetchResponse.getVectorsCount(), ids.size() - 1); |
There was a problem hiding this comment.
| assertEquals (fetchResponse.getVectorsCount(), ids.size() - 1); | |
| assertEquals(fetchResponse.getVectorsCount(), ids.size() - 1); |
…ies (#44) * fix(deps): clear open Dependabot alerts (jackson 2.21.7, netty 4.1.137, guava 33.7.2) Clears the 11 open Dependabot alerts without a breaking change. Existing POM dependencies change only in version; Guava, which every consumer already gets through grpc, is now declared directly. - jackson-databind and jackson-core 2.21.5 -> 2.21.7 (alerts #15-#21). Supersedes Dependabot PR #6. - Netty 4.1.136.Final -> 4.1.137.Final through the existing nettyVersion pin (alerts #12-#14). Stays on 4.1.x for grpc-netty 1.60.2. - Guava 32.0.1-android -> 33.7.2-android (alert #22). Guava comes from grpc, and no grpc release ships a patched Guava. A direct implementation dependency makes Maven consumers resolve 33.7.2 (nearest wins, widened to compile scope by grpc-api). A matching api constraint moves Gradle consumers' compile classpath too, which would otherwise still see 32.0.1 through grpc. * no-mistakes(review): Declare Guava 33.7.2 as a single api dependency * no-mistakes(document): Add CHANGELOG entry for security dependency bumps
Problem
The sdk currently lacks integration tests for future stub which is used for data plane operations.
Solution
Added integration test for all data plane operations for future stub. As a part of this change, I have organized the integration test folder better by moving and renaming files:
ConfigureIndexTest.java:src/integration/java/io/pinecone/integration/ConfigureIndexTest.java -> src/integration/java/io/pinecone/ControlPlane/ConfigureIndexTest.java
PineconeIndexOperationsClientIntegrationTest.javatoCreateAndDeleteIndexTest.javaand moved it from: src/integration/java/io/pinecone/PineconeIndexOperationsClientIntegrationTest.java -> src/integration/java/io/pinecone/ControlPlane/CreateAndDeleteIndexTest.javaPineconeClientLiveIntegTest.javatoSyncStubTest.javaand moved it from:src/integration/java/io/pinecone/PineconeClientLiveIntegTest.java ->
src/integration/java/io/pinecone/DataPlane/SyncStubTest.java
I have also updated some weird assert calls with the correct assert functionality in SyncStubTest.java so the only files to review are:
Type of Change
Test Plan
Ran integration tests.