Skip to content

Commit baad415

Browse files
authored
[Test] Fix grpc integration tests (#496)
## Problem A recent change submitted in PR #478 revealed some of the integration tests were not working as they should be working; some errors related to incorrect test setup were being masked. ## Solution Fix broken tests. ## Type of Change - [x] Bug fix (non-breaking change which fixes an issue)
2 parents 4223351 + 706351e commit baad415

40 files changed

+538
-160
lines changed

.github/actions/cleanup-all/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ inputs:
1212
PINECONE_ADDITIONAL_HEADERS:
1313
description: 'Additional headers to send with the request'
1414
required: false
15-
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
15+
default: '{"sdk-test-suite": "pinecone-python-client"}'
1616

1717
runs:
1818
using: 'composite'

.github/actions/create-index-legacy/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ inputs:
2626
PINECONE_ADDITIONAL_HEADERS:
2727
description: 'Additional headers to send with the request'
2828
required: false
29-
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
29+
default: '{"sdk-test-suite": "pinecone-python-client"}'
3030

3131
runs:
3232
using: 'composite'

.github/actions/create-index/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ inputs:
2828
PINECONE_ADDITIONAL_HEADERS:
2929
description: 'Additional headers to send with the request'
3030
required: false
31-
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
31+
default: '{"sdk-test-suite": "pinecone-python-client"}'
3232

3333

3434
outputs:

.github/actions/delete-index/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ inputs:
1111
PINECONE_ADDITIONAL_HEADERS:
1212
description: 'Additional headers to send with the request'
1313
required: false
14-
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
14+
default: '{"sdk-test-suite": "pinecone-python-client"}'
1515

1616

1717
runs:

.github/actions/test-data-asyncio/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ inputs:
1818
PINECONE_ADDITIONAL_HEADERS:
1919
description: 'Additional headers to send with the request'
2020
required: false
21-
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
21+
default: '{"sdk-test-suite": "pinecone-python-client"}'
2222
python_version:
2323
description: 'The version of Python to use'
2424
required: false
@@ -42,7 +42,7 @@ runs:
4242
- name: Run data plane tests
4343
id: data-plane-asyncio-tests
4444
shell: bash
45-
run: poetry run pytest tests/integration/data_asyncio --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
45+
run: poetry run pytest tests/integration/data_asyncio --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG
4646
env:
4747
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
4848
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}

.github/actions/test-data-plane/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ inputs:
2121
PINECONE_ADDITIONAL_HEADERS:
2222
description: 'Additional headers to send with the request'
2323
required: false
24-
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
24+
default: '{"sdk-test-suite": "pinecone-python-client"}'
2525
python_version:
2626
description: 'The version of Python to use'
2727
required: false
@@ -56,7 +56,7 @@ runs:
5656
- name: Run data plane tests
5757
id: data-plane-tests
5858
shell: bash
59-
run: poetry run pytest tests/integration/data --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
59+
run: poetry run pytest tests/integration/data --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG
6060
env:
6161
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
6262
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}

.github/actions/test-dependency-asyncio-rest/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
PINECONE_ADDITIONAL_HEADERS:
99
description: 'Additional headers to send with the request'
1010
required: false
11-
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
11+
default: '{"sdk-test-suite": "pinecone-python-client"}'
1212
index_name:
1313
description: 'The name of the index'
1414
required: true

.github/actions/test-dependency-grpc/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
PINECONE_ADDITIONAL_HEADERS:
99
description: 'Additional headers to send with the request'
1010
required: false
11-
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
11+
default: '{"sdk-test-suite": "pinecone-python-client"}'
1212
index_name:
1313
description: 'The name of the index'
1414
required: true

.github/actions/test-dependency-rest/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
PINECONE_ADDITIONAL_HEADERS:
99
description: 'Additional headers to send with the request'
1010
required: false
11-
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
11+
default: '{"sdk-test-suite": "pinecone-python-client"}'
1212
index_name:
1313
description: 'The name of the index'
1414
required: true

.github/workflows/testing-dependency-asyncio.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ jobs:
2727
python_version: '${{ matrix.python_version }}'
2828
index_name: '${{ inputs.index_name }}'
2929
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
30-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
30+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
3131
aiohttp_version: '${{ matrix.aiohttp_version }}'

.github/workflows/testing-dependency-grpc.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
python_version: '${{ matrix.python_version }}'
5454
index_name: '${{ inputs.index_name }}'
5555
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
56-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
56+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
5757
grpcio_version: '${{ matrix.grpcio_version }}'
5858
lz4_version: '${{ matrix.lz4_version }}'
5959
protobuf_version: '${{ matrix.protobuf_version }}'
@@ -87,7 +87,7 @@ jobs:
8787
python_version: '${{ matrix.python_version }}'
8888
index_name: '${{ inputs.index_name }}'
8989
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
90-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
90+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
9191
grpcio_version: '${{ matrix.grpcio_version }}'
9292
lz4_version: '${{ matrix.lz4_version }}'
9393
protobuf_version: '${{ matrix.protobuf_version }}'
@@ -120,7 +120,7 @@ jobs:
120120
python_version: '${{ matrix.python_version }}'
121121
index_name: '${{ inputs.index_name }}'
122122
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
123-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
123+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
124124
grpcio_version: '${{ matrix.grpcio_version }}'
125125
lz4_version: '${{ matrix.lz4_version }}'
126126
protobuf_version: '${{ matrix.protobuf_version }}'

.github/workflows/testing-dependency-rest.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
python_version: '${{ matrix.python_version }}'
3131
index_name: '${{ inputs.index_name }}'
3232
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
33-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
33+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
3434
urllib3_version: '${{ matrix.urllib3_version }}'
3535

3636

@@ -54,7 +54,7 @@ jobs:
5454
python_version: '${{ matrix.python_version }}'
5555
index_name: '${{ inputs.index_name }}'
5656
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
57-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
57+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
5858
urllib3_version: '${{ matrix.urllib3_version }}'
5959

6060
dependency-matrix-rest-313:
@@ -77,5 +77,5 @@ jobs:
7777
python_version: '${{ matrix.python_version }}'
7878
index_name: '${{ inputs.index_name }}'
7979
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
80-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
80+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
8181
urllib3_version: '${{ matrix.urllib3_version }}'

.github/workflows/testing-dependency.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
name_prefix: depstest-${{ github.run_number }}
2020
dimension: 2
2121
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
22-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
22+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
2323

2424
dependency-test-rest:
2525
uses: './.github/workflows/testing-dependency-rest.yaml'
@@ -56,4 +56,4 @@ jobs:
5656
with:
5757
index_name: '${{ needs.deps-test-setup.outputs.index_name }}'
5858
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
59-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
59+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'

.github/workflows/testing-integration-asyncio.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
- name: Run data plane tests
2727
id: data-plane-asyncio-tests
2828
shell: bash
29-
run: poetry run pytest tests/integration/data_asyncio --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
29+
run: poetry run pytest tests/integration/data_asyncio --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG
3030
env:
3131
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
32-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
32+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
3333

3434
db-control-asyncio:
3535
name: db_control asyncio
@@ -52,7 +52,7 @@ jobs:
5252
include_asyncio: true
5353
include_dev: true
5454
- name: 'db_control asyncio'
55-
run: poetry run pytest tests/integration/control_asyncio/*.py --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
55+
run: poetry run pytest tests/integration/control_asyncio/*.py --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG
5656
env:
5757
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
58-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
58+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'

.github/workflows/testing-integration.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
env:
1010
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
11-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
11+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
1212
strategy:
1313
fail-fast: false
1414
matrix:
@@ -51,10 +51,10 @@ jobs:
5151
with:
5252
include_asyncio: true
5353
- name: 'Run integration tests'
54-
run: poetry run pytest tests/integration/inference --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
54+
run: poetry run pytest tests/integration/inference --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG
5555
env:
5656
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
57-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
57+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
5858

5959
plugins:
6060
name: Plugin installation
@@ -76,7 +76,7 @@ jobs:
7676
run: poetry run pytest tests/integration/plugins --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG
7777
env:
7878
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
79-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
79+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
8080

8181

8282

@@ -107,7 +107,7 @@ jobs:
107107
metric: 'cosine'
108108
spec: '{ "serverless": { "region": "us-west-2", "cloud": "aws" }}'
109109
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
110-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
110+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
111111
freshness_timeout_seconds: 600
112112
skip_weird_id_tests: 'true'
113113

@@ -169,9 +169,9 @@ jobs:
169169
- name: Setup Poetry
170170
uses: ./.github/actions/setup-poetry
171171
- name: 'Run integration tests (REST)'
172-
run: poetry run pytest tests/integration/control/serverless --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
172+
run: poetry run pytest tests/integration/control/serverless --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG
173173
env:
174174
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
175-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
175+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
176176
SERVERLESS_CLOUD: '${{ matrix.testConfig.serverless.cloud }}'
177177
SERVERLESS_REGION: '${{ matrix.testConfig.serverless.region }}'

.github/workflows/testing-unit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
include_asyncio: true
5959

6060
- name: Run unit tests (REST)
61-
run: poetry run pytest --cov=pinecone --timeout=120 tests/unit --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
61+
run: poetry run pytest --cov=pinecone --timeout=120 tests/unit --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG
6262
- name: Run unit tests (GRPC)
6363
if: ${{ matrix.use_grpc == true }}
64-
run: poetry run pytest --cov=pinecone/grpc --timeout=120 tests/unit_grpc --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
64+
run: poetry run pytest --cov=pinecone/grpc --timeout=120 tests/unit_grpc --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG

pinecone/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"QueryResponse": ("pinecone.db_data.models", "QueryResponse"),
4242
"UpsertResponse": ("pinecone.db_data.models", "UpsertResponse"),
4343
"UpdateRequest": ("pinecone.db_data.models", "UpdateRequest"),
44-
"ImportErrorMode": ("pinecone.core.openapi.db_data.models", "ImportErrorMode"),
44+
"ImportErrorMode": ("pinecone.db_data.resources.sync.bulk_import", "ImportErrorMode"),
4545
"VectorDictionaryMissingKeysError": (
4646
"pinecone.db_data.errors",
4747
"VectorDictionaryMissingKeysError",

pinecone/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ from pinecone.db_data.models import (
2929
UpsertResponse,
3030
UpdateRequest,
3131
)
32-
from pinecone.core.openapi.db_data.models import ImportErrorMode
32+
from pinecone.db_data.resources.sync.bulk_import import ImportErrorMode
3333
from pinecone.db_data.errors import (
3434
VectorDictionaryMissingKeysError,
3535
VectorDictionaryExcessKeysError,

pinecone/data/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import warnings
22

3-
from pinecone.db_data import *
4-
53
warnings.warn(
64
"The module at `pinecone.data` has moved to `pinecone.db_data`. "
75
"Please update your imports. "

pinecone/data/features/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import warnings
22

3-
from pinecone.db_data.features import *
3+
from .bulk_imports import *
4+
from .inference import *
5+
46

57
warnings.warn(
6-
"The module at `pinecone.data.features` has moved to `pinecone.db_data.features`. "
7-
"Please update your imports. "
8+
"The module at `pinecone.data.features` has been removed. Code has been refactored and integrated into other parts of the client. "
89
"This warning will become an error in a future version of the Pinecone Python SDK.",
910
DeprecationWarning,
1011
)

pinecone/data/features/bulk_imports/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import warnings
22

3-
from pinecone.db_data.features.bulk_import import *
3+
from pinecone.db_data.resources.asyncio.bulk_import_asyncio import *
4+
from pinecone.db_data.resources.sync.bulk_import import *
5+
from pinecone.db_data.resources.sync.bulk_import_request_factory import *
6+
47

58
warnings.warn(
69
"The module at `pinecone.data.features.bulk_import` has moved to `pinecone.db_data.features.bulk_import`. "

pinecone/db_data/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
MetadataDictionaryExpectedError,
2626
)
2727

28-
from .features.bulk_import import ImportErrorMode
28+
from .resources.sync.bulk_import import ImportErrorMode
2929

3030

3131
import warnings

pinecone/db_data/features/bulk_import/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)