Skip to content

Add integration tests for future stub - #44

Closed
rohanshah18 wants to merge 4 commits into
mainfrom
rshah/addIntegTests
Closed

rohanshah18 wants to merge 4 commits into
mainfrom
rshah/addIntegTests

Conversation

@rohanshah18

@rohanshah18 rohanshah18 commented Nov 7, 2023 •

Copy link
Copy Markdown
Contributor

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:

  1. Moved ConfigureIndexTest.java:
    src/integration/java/io/pinecone/integration/ConfigureIndexTest.java -> src/integration/java/io/pinecone/ControlPlane/ConfigureIndexTest.java
  2. Renamed PineconeIndexOperationsClientIntegrationTest.java to CreateAndDeleteIndexTest.java and moved it from: src/integration/java/io/pinecone/PineconeIndexOperationsClientIntegrationTest.java -> src/integration/java/io/pinecone/ControlPlane/CreateAndDeleteIndexTest.java
  3. Renamed PineconeClientLiveIntegTest.java to SyncStubTest.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:

  1. AsyncStubTest.java
  2. SyncStubTest.java

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

Ran integration tests.

@rohanshah18
rohanshah18 marked this pull request as ready for review November 7, 2023 03:26

@jhamon jhamon left a comment

Copy link
Copy Markdown
Contributor

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.

private PineconeIndexOperationClient pinecone;
private String indexName;
private static final Logger logger = LoggerFactory.getLogger(PineconeClientLiveIntegTest.class);
private static final Logger logger = LoggerFactory.getLogger(SyncStubTest.class);

Copy link
Copy Markdown
Contributor

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 {

Copy link
Copy Markdown
Contributor

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
  • Upsert hybrid and query
  • Edge cases (missing params, invalid names, wrong vector dimension, etc)

Copy link
Copy Markdown
Contributor Author

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.

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assertEquals (fetchResponse.getVectorsCount(), ids.size() - 1);
assertEquals(fetchResponse.getVectorsCount(), ids.size() - 1);

@rohanshah18
rohanshah18 deleted the rshah/addIntegTests branch July 10, 2024 21:23
jhamon added a commit that referenced this pull request Nov 12, 2026
…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
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.

2 participants