Intelligent CI Test Selection for PRs #536
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intelligent CI Test Selection for PRs
Summary
This PR implements intelligent test selection for pull requests, automatically determining which integration test suites to run based on changed files. This reduces CI time and costs by running only relevant tests while maintaining safety through fallback mechanisms.
Problem
Previously, all integration test suites ran on every PR regardless of what code changed. This resulted in:
Solution
The implementation analyzes changed files in PRs and maps them to specific test suites. It includes:
Changes
1. Test Suite Mapping Script (
.github/scripts/determine-test-suites.py)pinecone/db_control/→ control tests (serverless, resources/index, resources/collections, asyncio variants)pinecone/db_data/→ data tests (sync, asyncio, gRPC)pinecone/inference/→ inference tests (sync, asyncio)pinecone/admin/→ admin testspinecone/grpc/→ gRPC-specific testspinecone/config/,pinecone/core/,pinecone/openapi_support/pinecone/utils/,pinecone/exceptions/pinecone.py,pinecone_asyncio.py, etc.)2. Updated PR Workflow (
.github/workflows/on-pr.yaml)determine-test-suitesjob that runs before integration testsrun_all_testsinput parameter for manual override via workflow dispatch3. Updated Integration Test Workflow (
.github/workflows/testing-integration.yaml)rest_sync_suites_jsonrest_asyncio_suites_jsongrpc_sync_suites_jsonadmin_suites_jsonUsage
Automatic (Default)
On every PR, the workflow automatically:
Manual Override
To force running all tests on a PR:
Safety Features
Example Scenarios
Scenario 1: Change only
pinecone/db_data/index.pydata,data_asyncio,data_grpc_futurestest suitescontrol/*,inference/*,admin,pluginstest suitesScenario 2: Change
pinecone/config/pinecone_config.pyScenario 3: Change
pinecone/inference/inference.pyinference/sync,inference/asynciotest suitesTesting
The implementation has been tested with:
Benefits
Backward Compatibility
Future Improvements
Potential enhancements for future PRs: