-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add integration tests for future stub #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really think we should split up this integration test into many smaller and more focused tests.
@@ -20,7 +20,7 @@ | |||
public class ConfigureIndexTest { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be ConfigureIndexTest.class
?
} | ||
|
||
@Test | ||
public void sanity() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -185,7 +187,7 @@ public void sanity() throws Exception { | |||
conn.getBlockingStub().delete(deleteRequest); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertEquals (fetchResponse.getVectorsCount(), ids.size() - 1); | |
assertEquals(fetchResponse.getVectorsCount(), ids.size() - 1); |
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.java
toCreateAndDeleteIndexTest.java
and moved it from: src/integration/java/io/pinecone/PineconeIndexOperationsClientIntegrationTest.java -> src/integration/java/io/pinecone/ControlPlane/CreateAndDeleteIndexTest.javaPineconeClientLiveIntegTest.java
toSyncStubTest.java
and 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.