Testing Guide for pgvectorscale
June 30, 2025 ยท View on GitHub
pgvectorscale has two main types of tests:
- Rust Tests - Using PGRX's
#[pg_test]framework (can be in any source file) - Python Tests - Using pytest for multi-process concurrency testing
Rust Tests
# Run all Rust tests
cd pgvectorscale && cargo pgrx test pg17
# Run specific test
cd pgvectorscale && cargo pgrx test pg17 test_name
Python Tests
# Setup (creates .venv virtual environment)
make test-python-setup
# Run all Python tests
make test-python
# Run specific categories
pytest tests/ -m concurrency -v # Multi-process concurrency tests
pytest tests/ -m integration -v # Basic integration tests
# For PGRX development (custom port)
DB_PORT=28817 ./scripts/run-python-tests.sh
Test Markers
@pytest.mark.concurrency- Multi-process concurrency tests@pytest.mark.integration- Basic integration tests
Prerequisites
For PGRX development:
cd pgvectorscale && cargo pgrx start pg17
cargo pgrx install --features pg17