Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1f7c71b
Integration test reorg
jhamon Nov 7, 2025
294cf3b
Remove some unneeded integration tests
jhamon Nov 7, 2025
45880db
Revise CI configs
jhamon Nov 7, 2025
b651306
Add pytest-split dep
jhamon Nov 7, 2025
5c7c105
Iterate
jhamon Nov 7, 2025
3161973
Iterating
jhamon Nov 7, 2025
18bd67f
Iterating
jhamon Nov 7, 2025
1d0d368
Iterate
jhamon Nov 7, 2025
f38852b
Iterate
jhamon Nov 7, 2025
ec42ce4
Iterate
jhamon Nov 7, 2025
c1fbee7
Iterate
jhamon Nov 7, 2025
c9c2d30
Move some tests to manual folder
jhamon Nov 7, 2025
dcd5d9b
Remove env vars for weird id testing
jhamon Nov 7, 2025
2bd9b12
reorg tests
jhamon Nov 10, 2025
751a23d
Remove pytest-split
jhamon Nov 10, 2025
5bee0da
Adjust grpc test
jhamon Nov 10, 2025
5548d27
Simplify tests
jhamon Nov 10, 2025
5b1cd5d
Disable collections tests
jhamon Nov 10, 2025
afb7965
Label test suites in CI
jhamon Nov 10, 2025
fe00c46
Adjust test fixtures to find name for pre-created indexes
jhamon Nov 10, 2025
6c4f439
Fix bug with test fixture
jhamon Nov 10, 2025
a58be51
Cover case when empty strings passed to Admin constructor
jhamon Nov 10, 2025
990bfe4
mypy fixes
jhamon Nov 10, 2025
9150871
Fix asyncio tests
jhamon Nov 11, 2025
1a0fcd0
Refactor namespace test to be robust when other tests make namespaces
jhamon Nov 11, 2025
8230d90
Fix broken test
jhamon Nov 11, 2025
3f55be7
Move collections tests into manual group
jhamon Nov 11, 2025
4cce734
Attempt sharding tests
jhamon Nov 11, 2025
73f1791
More shards
jhamon Nov 11, 2025
96582c7
Record test durations
jhamon Nov 11, 2025
1136baf
Fix test cleanup error
jhamon Nov 12, 2025
52e6a21
Reenable unit tests in CI
jhamon Nov 12, 2025
7107111
Update internal docs
jhamon Nov 12, 2025
17ec332
Fix on-pr config
jhamon Nov 12, 2025
1ea06da
Remove some sleeps
jhamon Nov 12, 2025
0283383
Improve polling
jhamon Nov 12, 2025
02e7f28
Split out sparse
jhamon Nov 12, 2025
d30abfe
Iterate
jhamon Nov 12, 2025
2605bd0
Iterate
jhamon Nov 12, 2025
850d012
Iterate
jhamon Nov 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,421 changes: 3,421 additions & 0 deletions .durations_grpc

Large diffs are not rendered by default.

167 changes: 167 additions & 0 deletions .durations_rest_asyncio

Large diffs are not rendered by default.

301 changes: 301 additions & 0 deletions .durations_rest_sync

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion .github/actions/index-create/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ inputs:
dimension:
description: 'The dimension of the index'
required: false
default: '3'
default: ''
metric:
description: 'The metric of the index'
required: false
default: 'cosine'
vector_type:
description: 'The type of the index'
required: false
default: 'dense'
PINECONE_API_KEY:
description: 'The Pinecone API key'
required: true
Expand All @@ -36,6 +40,10 @@ outputs:
description: 'The name of the index, including randomized suffix'
value: ${{ steps.create-index.outputs.index_name }}

index_host:
description: 'The host of the index'
value: ${{ steps.create-index.outputs.index_host }}

runs:
using: 'composite'
steps:
Expand All @@ -52,5 +60,6 @@ runs:
NAME_PREFIX: ${{ inputs.name_prefix }}
REGION: ${{ inputs.region }}
CLOUD: ${{ inputs.cloud }}
VECTOR_TYPE: ${{ inputs.vector_type }}
DIMENSION: ${{ inputs.dimension }}
METRIC: ${{ inputs.metric }}
70 changes: 30 additions & 40 deletions .github/actions/index-create/create.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
import re
import random
import string
from datetime import datetime
import uuid
from pinecone import Pinecone
from datetime import datetime


def read_env_var(name):
Expand All @@ -22,39 +22,9 @@ def write_gh_output(name, value):
print(f"{name}={value}", file=fh)


def generate_index_name(test_name: str) -> str:
github_actor = os.getenv("GITHUB_ACTOR", None)
user = os.getenv("USER", None)
index_owner = github_actor or user

formatted_date = datetime.now().strftime("%Y%m%d-%H%M%S%f")[:-3]

github_job = os.getenv("GITHUB_JOB", None)

if test_name.startswith("test_"):
test_name = test_name[5:]

# Remove trailing underscore, if any
if test_name.endswith("_"):
test_name = test_name[:-1]

name_parts = [index_owner, formatted_date, github_job, test_name]
index_name = "-".join([x for x in name_parts if x is not None])

# Remove invalid characters
replace_with_hyphen = re.compile(r"[\[\(_,\s]")
index_name = re.sub(replace_with_hyphen, "-", index_name)
replace_with_empty = re.compile(r"[\]\)\.]")
index_name = re.sub(replace_with_empty, "", index_name)

max_length = 45
index_name = index_name[:max_length]

# Trim final character if it is not alphanumeric
if index_name.endswith("_") or index_name.endswith("-"):
index_name = index_name[:-1]

return index_name.lower()
def generate_index_name(name_prefix: str) -> str:
name = name_prefix.lower() + "-" + str(uuid.uuid4())
return name[:45]


def get_tags():
Expand All @@ -74,15 +44,35 @@ def get_tags():

def main():
pc = Pinecone(api_key=read_env_var("PINECONE_API_KEY"))
index_name = generate_index_name(read_env_var("NAME_PREFIX") + random_string(20))
index_name = generate_index_name(read_env_var("NAME_PREFIX"))
dimension_var = read_env_var("DIMENSION")
if dimension_var is not None and dimension_var != "":
dimension = int(dimension_var)
else:
dimension = None

vector_type_var = read_env_var("VECTOR_TYPE")
if vector_type_var is not None and vector_type_var != "":
vector_type = vector_type_var
else:
vector_type = None

metric = read_env_var("METRIC")
cloud = read_env_var("CLOUD")
region = read_env_var("REGION")
tags = get_tags()

pc.create_index(
name=index_name,
metric=read_env_var("METRIC"),
dimension=int(read_env_var("DIMENSION")),
spec={"serverless": {"cloud": read_env_var("CLOUD"), "region": read_env_var("REGION")}},
tags=get_tags(),
metric=metric,
dimension=dimension,
vector_type=vector_type,
tags=tags,
spec={"serverless": {"cloud": cloud, "region": region}},
)
description = pc.describe_index(name=index_name)
write_gh_output("index_name", index_name)
write_gh_output("index_host", description.host)


if __name__ == "__main__":
Expand Down
38 changes: 35 additions & 3 deletions .github/actions/run-integration-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,29 @@ inputs:
PINECONE_ADDITIONAL_HEADERS:
description: 'Additional headers to send with the request'
required: false
default: '{"sdk-test-suite": "pinecone-python-client"}'
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
use_grpc:
description: 'Whether to use gRPC or REST'
required: false
default: 'false'
PINECONE_CLIENT_ID:
description: 'The client ID to use for admin tests'
required: false
PINECONE_CLIENT_SECRET:
description: 'The client secret to use for admin tests'
required: false
INDEX_HOST_DENSE:
description: 'The host of the dense index for db data tests'
required: false
INDEX_HOST_SPARSE:
description: 'The host of the sparse index for db data tests'
required: false
pytest_splits:
description: 'Number of shards to split tests into (for test sharding)'
required: false
pytest_group:
description: 'Which shard to run (1-indexed, for test sharding)'
required: false

runs:
using: 'composite'
Expand All @@ -33,9 +51,23 @@ runs:
- name: Run tests
id: run-tests
shell: bash
run: poetry run pytest tests/integration/${{ inputs.test_suite }} --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG --durations=20
run: |
PYTEST_ARGS=""
if [ -n "${{ inputs.pytest_splits }}" ] && [ -n "${{ inputs.pytest_group }}" ]; then
PYTEST_ARGS="--splits=${{ inputs.pytest_splits }} --group=${{ inputs.pytest_group }}"
fi
poetry run pytest ${{ inputs.test_suite }} \
$PYTEST_ARGS \
--retries 2 \
--retry-delay 35 \
--log-cli-level=DEBUG \
--durations=25 \
-s -vv
env:
PINECONE_API_KEY: ${{ steps.decrypt-api-key.outputs.decrypted_secret }}
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}
PINECONE_CLIENT_ID: ${{ inputs.PINECONE_CLIENT_ID }}
PINECONE_CLIENT_SECRET: ${{ inputs.PINECONE_CLIENT_SECRET }}
USE_GRPC: ${{ inputs.use_grpc }}
SKIP_WEIRD: 'true'
INDEX_HOST_DENSE: ${{ inputs.INDEX_HOST_DENSE }}
INDEX_HOST_SPARSE: ${{ inputs.INDEX_HOST_SPARSE }}
Loading
Loading