Skip to content

test: add comprehensive Python integration regression suite - #55

Merged
1yefuwang1 merged 11 commits into
mainfrom
add-python-integration-tests
Jun 23, 2026
Merged

test: add comprehensive Python integration regression suite#55
1yefuwang1 merged 11 commits into
mainfrom
add-python-integration-tests

Conversation

@1yefuwang1

Copy link
Copy Markdown
Owner

Summary

Adds a comprehensive, behavior-characterizing Python integration test suite (stdlib sqlite3) that locks down vectorlite's observable SQL behavior, so future changes (including larger refactors) cannot silently regress it. Test-only change — no C++ source modified.

New test files under bindings/python/vectorlite_py/test/ (+92 tests; full suite now 112 passing):

  • helpers.py / conftest.py — shared numpy reference helpers (brute_force_knn, per-space distance fns) and fixtures.
  • test_scalar_functions.pyvector_distance (l2/ip/cosine) vs numpy, vector_to_json/vector_from_json round-trip + errors, vectorlite_info.
  • test_vector_roundtrip.py — byte-exact f32 read-back, bf16/f16 dequant tolerances, cosine normalization.
  • test_knn_query.py — exact-match nearest, full ordering vs brute force (ef≥N), distance column vs numpy, k/ef validation, rowid filters, multiple knn_search, unconstrained-scan rejection.
  • test_ddl_options.py — all element types × spaces, hnsw option parsing, invalid options/syntax, hidden command columns.
  • test_dml.py — update, duplicate rowid, delete, capacity limits, allow_replace_deleted semantics, wrong-dim insert, large batch.
  • test_persistence.py — save/load across types, overwrite, mismatch/missing-file errors, multi-table, file-backed reopen, rename, vacuum.

Also includes the design spec and implementation plan under docs/superpowers/.

Determinism: all data uses fixed seeds; exact-ordering assertions use random_seed + ef≥N; reference math matches the extension (L2 is squared, per hnswlib).

Test Plan

  • PYTHONPATH=bindings/python python -m pytest bindings/python/vectorlite_py/test → 112 passed
  • No files modified outside bindings/python/vectorlite_py/test/ and docs/
  • Reference math independently cross-checked against C++ source in review

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

1yefuwang1 and others added 11 commits June 22, 2026 13:30
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
apsw was dropped on main (PR #54); Python >=3.14 stdlib sqlite3 (SQLite 3.50.4)
now provides loadable extensions and the required SQLite version.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…functions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CI only triggered on pull_request and workflow_dispatch, so the default
branch never populated the vcpkg binary cache. GitHub Actions caches are
branch-scoped, so every PR started cold and recompiled all vcpkg deps
from source (~20m on the Intel macOS runner).

Add a push trigger on main so the cache is saved on the default branch
and restorable by all PRs. Tighten the upload/publish job conditions to
require workflow_dispatch so the new push trigger does not spawn empty
publish jobs on every merge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@1yefuwang1
1yefuwang1 merged commit cb976ee into main Jun 23, 2026
7 checks passed
@1yefuwang1
1yefuwang1 deleted the add-python-integration-tests branch June 23, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant