We want to add CI that validates testing the Go SDK against an instance of pclocal hosted in a Docker container.
Solution
Update the ci.yaml GitHub workflow file to add a new services block, which includes using the ghcr.io/pinecone-io/pinecone-index:latest Docker image to create and how two indexes locally (pods and serverless).
Add new /pinecone/local_test.go which defines a new LocalIntegrationTests struct, which isolates a collection of tests specifically meant for pclocal. The tests are isolated from our unit + integration test suite with the //go:build localServer build tag. Two suites are defined for pods and serverless, and each set of tests is run against both indexes. For now the test suite generates 100 vectors, upserts them to the index, tests basic Fetch, Query, Update, DescribeIndexStats, and Delete.
Add a new Run local integration tests step to the ci.yaml workflow. This triggers the new local-test.go file which tests both instances of locally hosted indexes (PINECONE_INDEX_URL_POD, PINECONE_INDEX_URL_SERVERLESS) with go test -count=1 -v ./pinecone -run TestRunLocalIntegrationSuite -tags=localServer.
To Do
I'd like to expand the number of different tests we exercise on each index. Specifically:
Metadata filtering
Sparse vectors
Multiple namespaces
List vectors
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
[X] Infrastructure change (CI configs, etc)
[ ] Non-code change (docs, etc)
[ ] None of the above: (explain here)
Test Plan
Make sure the CI workflow passes for this PR.
If you'd like to run the local integration tests locally, you will need to download Docker, and use docker compose up to create the same indexes on your local machine. Once you've done that, you'll need to export environment variables for the different index addresses, along with the dimension.
Problem
We want to add CI that validates testing the Go SDK against an instance of pclocal hosted in a Docker container.
Solution
ci.yaml
GitHub workflow file to add a newservices
block, which includes using theghcr.io/pinecone-io/pinecone-index:latest
Docker image to create and how two indexes locally (pods and serverless)./pinecone/local_test.go
which defines a newLocalIntegrationTests
struct, which isolates a collection of tests specifically meant for pclocal. The tests are isolated from our unit + integration test suite with the//go:build localServer
build tag. Two suites are defined for pods and serverless, and each set of tests is run against both indexes. For now the test suite generates 100 vectors, upserts them to the index, tests basic Fetch, Query, Update, DescribeIndexStats, and Delete.Run local integration tests
step to theci.yaml
workflow. This triggers the newlocal-test.go
file which tests both instances of locally hosted indexes (PINECONE_INDEX_URL_POD
,PINECONE_INDEX_URL_SERVERLESS
) withgo test -count=1 -v ./pinecone -run TestRunLocalIntegrationSuite -tags=localServer
.To Do
I'd like to expand the number of different tests we exercise on each index. Specifically:
Type of Change
Test Plan
Make sure the CI workflow passes for this PR.
If you'd like to run the local integration tests locally, you will need to download Docker, and use
docker compose up
to create the same indexes on your local machine. Once you've done that, you'll need to export environment variables for the different index addresses, along with the dimension.Here's an example:
Then, you can run the local integration tests directly: