Skip to content

Commit 6efd333

Browse files
authored
Fix backup integration tests (#483)
## Problem The cleanup steps in the backup tests were deleting all backups in a project, which creates a problem when multiple jobs in a test matrix are running in parallel and backups may be suddenly deleted out from underneath a running test. ## Solution - Cleanup should only delete backups created with the current RUN_ID. This information is stored in index tags and is visible on the backup resource as well. - Cleanup duplication in conftest setup. It's easier to make these changes in one spot than in 6-8 spots. ## Type of Change - [x] Bug fix (non-breaking change which fixes an issue)
1 parent 5c0e37c commit 6efd333

40 files changed

+429
-1480
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ jobs:
5151
include_asyncio: true
5252
include_dev: true
5353
- name: 'db_control asyncio'
54-
run: poetry run pytest tests/integration/control_asyncio --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
54+
run: poetry run pytest tests/integration/control_asyncio/*.py --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
5555
env:
5656
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'

.github/workflows/testing-integration.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ jobs:
77
name: Reorg tests
88
runs-on: ubuntu-latest
99
env:
10-
PINECONE_DEBUG_CURL: 'true'
10+
PINECONE_DEBUG_CURL: 'false'
1111
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
1212
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
1313
strategy:
1414
fail-fast: false
1515
matrix:
1616
python_version: [3.9, 3.12]
1717
test_suite:
18-
- tests/integration/control/index
19-
- tests/integration/control/collections
20-
- tests/integration/control/backup
21-
- tests/integration/control/restore_job
22-
- tests/integration/control_asyncio/index
23-
- tests/integration/control_asyncio/backup
24-
- tests/integration/control_asyncio/restore_job
18+
- tests/integration/control/resources/index
19+
- tests/integration/control/resources/collections
20+
- tests/integration/control/resources/backup
21+
- tests/integration/control/resources/restore_job
22+
- tests/integration/control_asyncio/resources/index
23+
- tests/integration/control_asyncio/resources/backup
24+
- tests/integration/control_asyncio/resources/restore_job
2525
steps:
2626
- uses: actions/checkout@v4
2727
- name: 'Set up Python ${{ matrix.python_version }}'

pinecone/db_control/resources/sync/backup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def list(
2323
List backups for an index or for the project.
2424
2525
Args:
26-
index_name (str): The name of the index to list backups for.
26+
index_name (str): The name of the index to list backups for. If not provided, list all backups for the project.
2727
limit (int): The maximum number of backups to return.
2828
pagination_token (str): The pagination token to use for the next page of backups.
2929
"""

tests/integration/control/backup/conftest.py

-168
This file was deleted.

tests/integration/control/collections/conftest.py

-136
This file was deleted.

0 commit comments

Comments
 (0)