Repository navigation
docs(core): add the #1708 edit-note help entry to the changelog #4887
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| concurrency: | |
| group: bm-ci-${{ github.workflow }}-${{ github.repository }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| # Trigger: PR branch pushes already publish commit statuses that show up on the PR. | |
| # Why: running the full matrix on both push and pull_request doubles CI time for the | |
| # exact same branch head commit. | |
| # Outcome: each branch push runs the test suite once, including PR updates. | |
| push: | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| # Branch builds (PRs arrive as push events — this workflow has no | |
| # pull_request trigger) select only impacted tests from the cached testmon | |
| # baseline (branch cache falling back to main's full-run recording). Pushes | |
| # to main run the full suite with --testmon-noselect to refresh the baseline. | |
| BASIC_MEMORY_TESTMON_FLAGS: ${{ github.ref_name == 'main' && '--testmon-noselect' || '--testmon --testmon-forceselect' }} | |
| # Every job that builds a uv environment sets UV_PYTHON. Without it, `uv run` | |
| # — which every `just` recipe shells out to — resolves its interpreter from | |
| # .python-version (3.14) rather than the matrix version, and DELETES a .venv | |
| # that disagrees, taking the pip-installed extras with it. That is why the | |
| # 3.12/3.13 matrix rows silently tested 3.14 and why typecheck lost pymilvus. | |
| jobs: | |
| changes: | |
| # Docs/workflow-only changes skip the entire test matrix while the workflow | |
| # still concludes successfully. | |
| name: Detect code changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| code: ${{ steps.filter.outputs.code }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| # Tests only runs on push events; for branch pushes compare against | |
| # main (merge-base), for main pushes dorny diffs the push range. | |
| base: main | |
| filters: | | |
| code: | |
| - 'src/**' | |
| - 'tests/**' | |
| - 'test-int/**' | |
| - 'alembic/**' | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - 'justfile' | |
| - '.github/workflows/test.yml' | |
| static-checks: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| name: Static Checks (Python 3.12) | |
| timeout-minutes: 20 | |
| runs-on: ubuntu-latest | |
| # Pin every uv call, including `uv run` inside just recipes. See top of file. | |
| env: | |
| UV_PYTHON: "3.12" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - uses: extractions/setup-just@v4 | |
| - name: Create virtual env | |
| run: | | |
| uv venv | |
| - name: Install dependencies | |
| run: | | |
| uv pip install -e ".[dev,milvus,pdf]" | |
| - name: Run type checks | |
| run: | | |
| just typecheck | |
| - name: Run linting | |
| run: | | |
| just lint | |
| test-sqlite-unit: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| name: Test SQLite Unit (${{ matrix.os }}, Python ${{ matrix.python-version }}) | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: ["3.12", "3.13", "3.14"] | |
| exclude: | |
| # Windows carries platform coverage on one Python version. | |
| - os: windows-latest | |
| python-version: "3.13" | |
| - os: windows-latest | |
| python-version: "3.14" | |
| # Windows is the slowest row, so branch pushes skip it and main runs it. | |
| - os: ${{ github.ref_name == 'main' && 'none' || 'windows-latest' }} | |
| python-version: "3.12" | |
| runs-on: ${{ matrix.os }} | |
| # Pin every uv call, including `uv run` inside just recipes. See top of file. | |
| env: | |
| UV_PYTHON: ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - uses: extractions/setup-just@v4 | |
| - name: Cache pytest-testmon results | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .testmondata | |
| .testmondata-shm | |
| .testmondata-wal | |
| key: ${{ runner.os }}-testmon-sqlite-unit-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-testmon-sqlite-unit-py${{ matrix.python-version }}-${{ github.ref_name }}- | |
| ${{ runner.os }}-testmon-sqlite-unit-py${{ matrix.python-version }}-main- | |
| ${{ runner.os }}-testmon-sqlite-unit-py${{ matrix.python-version }}- | |
| - name: Create virtual env | |
| run: | | |
| uv venv | |
| - name: Install dependencies | |
| run: | | |
| uv pip install -e ".[dev,pdf]" | |
| - name: Run tests | |
| run: | | |
| just test-unit-sqlite | |
| test-sqlite-integration: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| name: Test SQLite Integration (${{ matrix.os }}, Python ${{ matrix.python-version }}) | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: ["3.12", "3.13", "3.14"] | |
| exclude: | |
| # Windows carries platform coverage on one Python version. | |
| - os: windows-latest | |
| python-version: "3.13" | |
| - os: windows-latest | |
| python-version: "3.14" | |
| # Windows is the slowest row, so branch pushes skip it and main runs it. | |
| - os: ${{ github.ref_name == 'main' && 'none' || 'windows-latest' }} | |
| python-version: "3.12" | |
| runs-on: ${{ matrix.os }} | |
| # Pin every uv call, including `uv run` inside just recipes. See top of file. | |
| env: | |
| UV_PYTHON: ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - uses: extractions/setup-just@v4 | |
| - name: Cache pytest-testmon results | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .testmondata | |
| .testmondata-shm | |
| .testmondata-wal | |
| key: ${{ runner.os }}-testmon-sqlite-integration-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-testmon-sqlite-integration-py${{ matrix.python-version }}-${{ github.ref_name }}- | |
| ${{ runner.os }}-testmon-sqlite-integration-py${{ matrix.python-version }}-main- | |
| ${{ runner.os }}-testmon-sqlite-integration-py${{ matrix.python-version }}- | |
| - name: Create virtual env | |
| run: | | |
| uv venv | |
| - name: Install dependencies | |
| run: | | |
| uv pip install -e ".[dev,pdf]" | |
| - name: Run tests | |
| run: | | |
| just test-int-sqlite | |
| test-postgres-unit: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| name: Test Postgres Unit (Python ${{ matrix.python-version }}, shard ${{ matrix.group }}/3) | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Shard the largest suite across parallel jobs: each shard is a full job | |
| # with its own Postgres service running 1/3 of the collection, balanced | |
| # by the recorded .test_durations (refresh with `just test-durations-postgres`). | |
| # Postgres runs on the latest Python only — the SQLite matrix carries | |
| # Python-version coverage; Postgres carries backend coverage. | |
| group: [1, 2, 3] | |
| python-version: ["3.14"] | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: pgvector/pgvector:pg16 | |
| env: | |
| POSTGRES_USER: basic_memory_user | |
| POSTGRES_PASSWORD: dev_password | |
| POSTGRES_DB: basic_memory_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U basic_memory_user -d basic_memory_test" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| BASIC_MEMORY_TEST_POSTGRES_URL: postgresql://basic_memory_user:dev_password@127.0.0.1:5432/basic_memory_test | |
| # Pin every uv call, including `uv run` inside just recipes. See top of file. | |
| UV_PYTHON: ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - uses: extractions/setup-just@v4 | |
| - name: Cache pytest-testmon results | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .testmondata | |
| .testmondata-shm | |
| .testmondata-wal | |
| key: ${{ runner.os }}-testmon-postgres-unit-py${{ matrix.python-version }}-g${{ matrix.group }}-${{ github.ref_name }}-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-testmon-postgres-unit-py${{ matrix.python-version }}-g${{ matrix.group }}-${{ github.ref_name }}- | |
| ${{ runner.os }}-testmon-postgres-unit-py${{ matrix.python-version }}-g${{ matrix.group }}-main- | |
| ${{ runner.os }}-testmon-postgres-unit-py${{ matrix.python-version }}-main- | |
| ${{ runner.os }}-testmon-postgres-unit-py${{ matrix.python-version }}- | |
| - name: Create virtual env | |
| run: | | |
| uv venv | |
| - name: Install dependencies | |
| run: | | |
| uv pip install -e ".[dev,pdf]" | |
| - name: Run tests | |
| run: | | |
| BASIC_MEMORY_PYTEST_SPLIT_FLAGS="--splits 3 --group ${{ matrix.group }}" just test-unit-postgres | |
| test-postgres-integration: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| name: Test Postgres Integration (Python ${{ matrix.python-version }}) | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Latest Python only: SQLite carries version coverage, Postgres carries | |
| # backend coverage. | |
| python-version: ["3.14"] | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: pgvector/pgvector:pg16 | |
| env: | |
| POSTGRES_USER: basic_memory_user | |
| POSTGRES_PASSWORD: dev_password | |
| POSTGRES_DB: basic_memory_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U basic_memory_user -d basic_memory_test" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| BASIC_MEMORY_TEST_POSTGRES_URL: postgresql://basic_memory_user:dev_password@127.0.0.1:5432/basic_memory_test | |
| # Pin every uv call, including `uv run` inside just recipes. See top of file. | |
| UV_PYTHON: ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - uses: extractions/setup-just@v4 | |
| - name: Cache pytest-testmon results | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .testmondata | |
| .testmondata-shm | |
| .testmondata-wal | |
| key: ${{ runner.os }}-testmon-postgres-integration-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-testmon-postgres-integration-py${{ matrix.python-version }}-${{ github.ref_name }}- | |
| ${{ runner.os }}-testmon-postgres-integration-py${{ matrix.python-version }}-main- | |
| ${{ runner.os }}-testmon-postgres-integration-py${{ matrix.python-version }}- | |
| - name: Create virtual env | |
| run: | | |
| uv venv | |
| - name: Install dependencies | |
| run: | | |
| uv pip install -e ".[dev,pdf]" | |
| - name: Run tests | |
| run: | | |
| just test-int-postgres | |
| test-semantic: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| name: Test Semantic (Python 3.12) | |
| timeout-minutes: 45 | |
| runs-on: ubuntu-latest | |
| # Pin every uv call, including `uv run` inside just recipes. See top of file. | |
| env: | |
| UV_PYTHON: "3.12" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - uses: extractions/setup-just@v4 | |
| - name: Cache pytest-testmon results | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .testmondata | |
| .testmondata-shm | |
| .testmondata-wal | |
| key: ${{ runner.os }}-testmon-semantic-py3.12-${{ github.ref_name }}-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-testmon-semantic-py3.12-${{ github.ref_name }}- | |
| ${{ runner.os }}-testmon-semantic-py3.12-main- | |
| ${{ runner.os }}-testmon-semantic-py3.12- | |
| - name: Create virtual env | |
| run: | | |
| uv venv | |
| - name: Install dependencies | |
| run: | | |
| uv pip install -e ".[dev,pdf]" | |
| - name: Run tests | |
| run: | | |
| just test-semantic | |
| test-milvus: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| name: Test Milvus (${{ matrix.os }}, Python ${{ matrix.python-version }}) | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| python-version: "3.12" | |
| - os: macos-latest | |
| python-version: "3.13" | |
| - os: windows-latest | |
| python-version: "3.12" | |
| runs-on: ${{ matrix.os }} | |
| # Pin every uv call, including `uv run` inside just recipes. See top of file. | |
| env: | |
| UV_PYTHON: ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Install uv | |
| run: | | |
| pip install uv | |
| - name: Create virtual env | |
| run: | | |
| uv venv | |
| - name: Install Milvus extra | |
| run: | | |
| uv pip install -e ".[dev,milvus,pdf]" | |
| - name: Run Milvus tests | |
| run: | | |
| uv run pytest -q --no-cov tests/repository/test_milvus_config.py tests/repository/test_milvus_repository.py tests/repository/test_milvus_index.py test-int/semantic/test_milvus_lite.py |