vCache includes both unit tests and integration tests to ensure correctness and reliability across its modular components.
To enable testing capabilities, install vCache with the benchmarks and dev extras from the project root:
pip install -e .[benchmarks,dev]Unit tests verify the logic of individual module strategies (e.g., caching policies, embedding engines, similarity evaluators) in isolation.
They are designed to be fast, deterministic, and independent of external services.
python -m pytest tests/unit Integration tests validate the end-to-end behavior of vCache by checking how components interact (e.g., LLM inference + vector database + thresholding policy).
They may involve real API calls and require a valid OpenAI key.
- Export your OpenAI key:
export OPENAI_API_KEY="your_key_here"- Run the tests using Poetry:
python -m pytest tests/integration