Testing guide for pgvectorscale
pgvectorscale has two main types of tests:
Testing guide for pgvectorscale
Section titled “Testing guide for pgvectorscale”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
Section titled “Rust tests”# Run all Rust testscd pgvectorscale && cargo pgrx test pg17
# Run specific testcd pgvectorscale && cargo pgrx test pg17 test_namePython tests
Section titled “Python tests”# Setup (creates .venv virtual environment)make test-python-setup
# Run all Python testsmake test-python
# Run specific categoriespytest tests/ -m concurrency -v # Multi-process concurrency testspytest tests/ -m integration -v # Basic integration tests
# For PGRX development (custom port)DB_PORT=28817 ./scripts/run-python-tests.shTest markers
Section titled “Test markers”@pytest.mark.concurrency- Multi-process concurrency tests@pytest.mark.integration- Basic integration tests
Prerequisites
Section titled “Prerequisites”For PGRX development:
cd pgvectorscale && cargo pgrx start pg17cargo pgrx install --features pg17