Repository navigation
Data plane integration testing suite #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1fc6d47
29f5221
9e22fa8
9e2c55c
ade89fb
3fcafb2
c66a8ba
c336400
018b57c
434ff04
3c364ae
0189031
f80b60e
679bbf9
677cff7
a8a725d
3264c08
1fc8768
e63047d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: 'Test Data Plane' | ||
| description: 'Runs tests on the Pinecone data plane' | ||
|
|
||
| # - pod vs serverless | ||
| # - grpc vs rest | ||
| # - metric -> vector vs sparse vector | ||
| # - namespace: default vs custom | ||
| # - environment: free vs paid | ||
| # - with metadata vs without metadata | ||
|
|
||
| inputs: | ||
| metric: | ||
| description: 'The metric of the index' | ||
| required: true | ||
| spec: | ||
| description: 'The deploy spec of the index' | ||
| required: true | ||
| use_grpc: | ||
| description: 'Whether to use gRPC or REST' | ||
| required: true | ||
| freshness_timeout_seconds: | ||
| description: 'The number of seconds to wait for the index to become fresh' | ||
| required: false | ||
| default: '60' | ||
| PINECONE_API_KEY: | ||
| description: 'The Pinecone API key' | ||
| required: true | ||
|
|
||
| outputs: | ||
| index_name: | ||
| description: 'The name of the index, including randomized suffix' | ||
| value: ${{ steps.create-index.outputs.index_name }} | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: 3.9 | ||
|
|
||
| - name: Setup Poetry | ||
| uses: ./.github/actions/setup-poetry | ||
| with: | ||
| include_grpc: ${{ inputs.use_grpc }} | ||
| include_dev: 'true' | ||
|
|
||
| - name: Run data plane tests | ||
| id: data-plane-tests | ||
| shell: bash | ||
| run: poetry run pytest tests/integration/data | ||
| env: | ||
| PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }} | ||
| USE_GRPC: ${{ inputs.use_grpc }} | ||
| METRIC: ${{ inputs.metric }} | ||
| SPEC: ${{ inputs.spec }} | ||
| FRESHNESS_TIMEOUT_SECONDS: ${{ inputs.freshness_timeout_seconds }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,11 @@ | ||
| name: Testing GRPC | ||
| name: Dependency Testing | ||
|
|
||
| on: | ||
| workflow_call: {} | ||
|
|
||
| jobs: | ||
| units-grpc: | ||
| name: Unit tests (GRPC) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: [3.8, 3.9, '3.10', 3.11] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Setup Poetry | ||
| uses: ./.github/actions/setup-poetry | ||
| with: | ||
| include_grpc: true | ||
|
|
||
| - name: Run unit tests (GRPC) | ||
| run: poetry run pytest --cov=pinecone --timeout=120 tests/unit_grpc | ||
|
|
||
| - name: mypy check | ||
| run: | | ||
| # Still lots of errors when running on the whole package (especially | ||
| # in the generated core module), but we can check these subpackages | ||
| # so we don't add new regressions. | ||
| poetry run mypy pinecone --exclude pinecone/core | ||
|
|
||
| dependency-matrix-grpc-setup: | ||
| name: Deps setup (GRPC) | ||
| dependency-matrix-setup: | ||
| name: Deps setup | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| index_name: ${{ steps.setup-index.outputs.index_name }} | ||
|
|
@@ -46,13 +16,13 @@ jobs: | |
| uses: ./.github/actions/create-index | ||
| timeout-minutes: 5 | ||
| with: | ||
| name_prefix: depstest-grpc-${{ github.run_number }} | ||
| name_prefix: depstest-${{ github.run_number }} | ||
| dimension: 2 | ||
| PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | ||
|
|
||
| dependency-matrix-grpc: | ||
| name: Deps (GRPC) | ||
| needs: dependency-matrix-grpc-setup | ||
| needs: dependency-matrix-setup | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| max-parallel: 5 | ||
|
|
@@ -124,5 +94,49 @@ jobs: | |
| command: poetry run pytest tests/dependency/grpc -s -v | ||
| env: | ||
| PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | ||
| INDEX_NAME: ${{ needs.dependency-matrix-grpc-setup.outputs.index_name }} | ||
|
|
||
| INDEX_NAME: ${{ needs.dependency-matrix-setup.outputs.index_name }} | ||
|
|
||
|
|
||
|
|
||
|
|
||
| dependency-matrix-rest: | ||
| name: Deps (REST) | ||
| runs-on: ubuntu-latest | ||
| needs: dependency-matrix-setup | ||
| strategy: | ||
| max-parallel: 5 | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: | ||
| - 3.8 | ||
| - 3.9 | ||
| - '3.10' | ||
| - 3.11 | ||
|
Comment on lines
+111
to
+114
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything but
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eh, not exactly. Mainly just trying to save some time and resources while iterating. I should bring them back on the grpc job. |
||
| urllib3-version: | ||
| - 1.26.0 | ||
| - 1.26.18 | ||
| - 2.0.2 | ||
| - 2.0.5 | ||
| - 2.1.0 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: 'Set up Python ${{ matrix.python-version }}' | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '${{ matrix.python-version }}' | ||
| - name: Setup Poetry | ||
| uses: ./.github/actions/setup-poetry | ||
| with: | ||
| include_grpc: false | ||
| include_types: false | ||
| - name: 'Install urllib3 ${{ matrix.urllib3-version }}' | ||
| run: 'poetry add urllib3==${{ matrix.urllib3-version }}' | ||
| - uses: nick-fields/retry@v2 | ||
| with: | ||
| timeout_minutes: 5 | ||
| max_attempts: 3 | ||
| retry_on: error | ||
| command: poetry run pytest tests/dependency/rest -s -v | ||
| env: | ||
| PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}' | ||
| INDEX_NAME: '${{ needs.dependency-matrix-setup.outputs.index_name }}' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| name: "Integration Tests" | ||
| 'on': | ||
| workflow_call: {} | ||
|
|
||
| jobs: | ||
| data-plane-serverless: | ||
| name: Data plane serverless integration tests | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| use_grpc: [true, false] | ||
| metric: | ||
| - cosine | ||
| # - euclidean | ||
| # - dotproduct | ||
|
Comment on lines
+15
to
+16
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming you want to keep these commented out for now, but if not.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, leaving them out while still fleshing out the tests and iterating heavily. Dotproduct is having some kind of performance issue at the moment the db team are looking into. |
||
| spec: | ||
| - '{ "serverless": { "region": "us-west-2", "cloud": "aws" }}' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: ./.github/actions/test-data-plane | ||
| with: | ||
| use_grpc: '${{ matrix.use_grpc }}' | ||
| metric: '${{ matrix.metric }}' | ||
| spec: '${{ matrix.spec }}' | ||
| PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}' | ||
| freshness_timeout_seconds: 600 | ||
|
|
||
| # data-plane-pod: | ||
| # name: Data plane pod integration tests | ||
| # runs-on: ubuntu-latest | ||
| # strategy: | ||
| # max-parallel: 1 | ||
| # matrix: | ||
| # use_grpc: [true, false] | ||
| # metric: [cosine, dotproduct] | ||
| # spec: | ||
| # - '{ "pod": { "environment": "us-east1-gcp", "pod_type": "p1" }}' | ||
| # steps: | ||
| # - uses: actions/checkout@v4 | ||
| # - uses: ./.github/actions/test-data-plane | ||
| # with: | ||
| # use_grpc: '${{ matrix.use_grpc }}' | ||
| # metric: '${{ matrix.metric }}' | ||
| # spec: '${{ matrix.spec }}' | ||
| # PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}' | ||
|
|
||
| control-rest: | ||
| name: control plane | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| pineconeEnv: | ||
| - prod | ||
| testConfig: | ||
| - python-version: 3.8 # Do one test run with 3.8 for sanity check | ||
| pod: { environment: 'us-east1-gcp'} | ||
| serverless: { cloud: 'aws', region: 'us-west-2'} | ||
| - python-version: 3.11 | ||
| pod: { environment: 'us-east1-gcp'} | ||
| serverless: { cloud: 'aws', region: 'us-west-2'} | ||
| max-parallel: 1 | ||
| fail-fast: false | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: 'Set up Python ${{ matrix.testConfig.python-version }}' | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '${{ matrix.testConfig.python-version }}' | ||
| - name: Setup Poetry | ||
| uses: ./.github/actions/setup-poetry | ||
| - name: 'Run integration tests (REST, prod)' | ||
| if: matrix.pineconeEnv == 'prod' | ||
| run: poetry run pytest tests/integration/control -s -v | ||
| env: | ||
| PINECONE_CONTROLLER_HOST: 'https://api.pinecone.io' | ||
| PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}' | ||
| GITHUB_BUILD_NUMBER: '${{ github.run_number }}-p-${{ matrix.testConfig.python-version}}' | ||
| POD_ENVIRONMENT: '${{ matrix.testConfig.pod.environment }}' | ||
| SERVERLESS_CLOUD: '${{ matrix.testConfig.serverless.cloud }}' | ||
| SERVERLESS_REGION: '${{ matrix.testConfig.serverless.region }}' | ||
| - name: 'Run integration tests (REST, staging)' | ||
| if: matrix.pineconeEnv == 'staging' | ||
| run: poetry run pytest tests/integration -s -v | ||
| env: | ||
| PINECONE_CONTROLLER_HOST: 'https://api-staging.pinecone.io' | ||
| PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY_STAGING }}' | ||
| GITHUB_BUILD_NUMBER: '${{ github.run_number }}-s-${{ matrix.testConfig.python-version}}' | ||
| POD_ENVIRONMENT: '${{ matrix.testConfig.pod.environment }}' | ||
| SERVERLESS_CLOUD: '${{ matrix.testConfig.serverless.cloud }}' | ||
| SERVERLESS_REGION: '${{ matrix.testConfig.serverless.region }}' | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this referring to a different
create-indexstep that's present in this action, or is it assuming it's been run prior? It's working properly so I'm just going to assume the scope forsteps.<whatever>is global to the whole workflow. 😅There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this
outputsdeclaration is just accidental copy/pasta from thecreate-indexaction I made earlier this week for dependency testing purposes so it can be removed. If I wanted to use it I could by having my test suite write the name of the index it creates to theGITHUB_OUTPUTlocation (see here in script used by create-index action) but in this case it's not needed since the test creates and deletes the index.