Conversation
|
@copilot fix precommit-ci errors: |
There was a problem hiding this comment.
Pull request overview
This PR aims to speed up local development workflows by enabling parallel pytest execution (via pytest-xdist), adding retry support for flaky tests, and documenting the test suite / parallel execution behavior.
Changes:
- Add pytest-xdist + pytest-rerunfailures to the base test requirements.
- Introduce new pytest fixtures/configuration intended to improve isolation when running tests in parallel (SQL schema isolation, per-worker cache dirs).
- Extend
scripts/test-local.shand add test-suite documentation undertests/README.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
tests/requirements.txt |
Adds dependencies for parallel runs / flaky retries (but currently drops an async dependency needed by the suite). |
tests/conftest.py |
Adds fixtures/options to support parallel-safe execution across backends (SQL schema + cache-dir isolation). |
tests/README.md |
Adds comprehensive test-suite and parallel-execution documentation. |
scripts/test-local.sh |
Adds -p/-w support and attempts to split out serial local tests while running the rest in parallel. |
pyproject.toml |
Updates pytest/coverage configuration and adds a Black config section. |
Comments suppressed due to low confidence (1)
tests/conftest.py:240
- The custom
--parallel/--parallel-workersoptions are added here but aren’t used anywhere (no hook that converts them into xdist’s-nbehavior). As a result, runningpytest --parallelwill not actually run tests in parallel. Either implement the wiring (e.g., translate these options into-n) or drop these custom options to avoid a misleading CLI.
default="auto",
help="Number of parallel workers (default: auto)",
)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #349 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 12 12
Lines 1701 1701
Branches 213 213
=========================================
Hits 1701 1701
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
@copilot fix failing tests |
|
@copilot fix a regression in a couple of local tests: |
This commit extracts testing improvements from the feature branch, focusing on infrastructure enhancements without feature code: - Add pytest-xdist for parallel test execution - Add pytest-rerunfailures for handling flaky tests - Update test-local.sh script with -p (parallel) and -w (workers) flags - Add seriallocal marker for tests requiring sequential execution - Configure coverage for parallel execution - Add comprehensive fixtures in conftest.py: - `isolated_cache_directory`: Ensures pickle tests use worker-specific cache dirs - `inject_worker_schema_for_sql_tests`: Provides SQL schema isolation per worker - `cleanup_mongo_clients`: Proper MongoDB client cleanup to prevent ResourceWarning - `cleanup_test_schemas`: Cleanup SQL schemas after parallel test runs - Consolidate backend tests into dedicated files: - tests/test_mongo_core.py (MongoDB tests with cleanup improvements) - tests/test_pickle_core.py (Pickle tests with flaky handling) - tests/test_redis_core.py (Redis tests with isolation) - tests/test_sql_core.py (SQL tests with schema isolation) - Add comprehensive tests/README.md with: - Test suite overview and structure - Guidelines for writing isolated tests - Parallel testing documentation - Backend-specific testing instructions - Troubleshooting guide - Mark flaky tests with @pytest.mark.flaky for automatic retries - Add platform-specific timing adjustments (macOS vs Linux) - Improve MongoDB client tracking and cleanup - Add custom mongetter function for collection isolation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
for more information, see https://pre-commit.ci
* Initial plan * Fix SIM108: use ternary operator for cache_dir assignment in conftest.py Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…flow (#351) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com>
* Fix SQL test module path in conftest.py fixture Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com> * Initial plan --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com>
…354) * Initial plan * Extend isolated_cache_directory fixture to cover maxage-marked tests Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com>
* Initial plan * Add pytest-asyncio back to tests/requirements.txt Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com>
) * Initial plan * Fix regression: only apply cache isolation in parallel (xdist) mode Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com> * Apply ruff format to conftest.py to fix pre-commit.ci formatting error Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com>
|
@Borda Hey! Please take a look and review. :) |
No description provided.