Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.knowledgestack.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Knowledge Stack maintains a comprehensive test suite to ensure reliability across all features. This page describes the testing approach, which is useful if you are contributing to the project, running your own tests, or evaluating the platform’s quality guarantees.

Test Coverage

Knowledge Stack uses two levels of automated testing:

Integration Tests

Integration tests verify individual features and API endpoints in isolation. Each test runs against a real PostgreSQL database (automatically provisioned) and is fully rolled back after execution, ensuring tests do not interfere with each other. Coverage includes:
  • All API endpoints (success cases, error cases, authorization)
  • Database operations and constraints
  • Business logic and validation rules
  • External service interactions (recorded and replayed for consistency)

End-to-End Tests

End-to-end tests validate complete user workflows against a fully running Knowledge Stack instance. These tests use the generated SDK to interact with the API, simulating real client behavior. Coverage includes:
  • Full document lifecycle (upload, ingestion, retrieval)
  • User authentication and tenant management
  • Folder and document navigation
  • Search and content retrieval

Running Tests

If you are working with the Knowledge Stack codebase, you can run the full test suite:

Integration Tests

# Run all integration tests
make test

# Run a specific test file
uv run pytest tests/path/to/test_file.py -v --no-cov
Integration tests do not require any external services to be running. Each test automatically provisions its own database.

End-to-End Tests

# Start the infrastructure services
make dev-stack

# Start the E2E API server
make e2e-api

# Run all end-to-end tests
make e2e-test

Code Quality Checks

make lint        # Check code style
make typecheck   # Verify type annotations
make pre-commit  # Run all checks together

Test Quality Standards

Every feature in Knowledge Stack follows these testing requirements:
  • Retrieval operations: Tested for both “found” and “not found” cases
  • Creation operations: Tested for success, constraint violations, and required vs. optional fields
  • Update operations: Tested for success, not found, and validation errors
  • Deletion operations: Tested for success and not found
  • Authorization: Tested for both permitted and forbidden users where applicable

External Service Recording

Tests that interact with external services (such as LLM providers) use recorded HTTP interactions for deterministic replay. This means:
  • Tests produce the same results every time, regardless of network conditions
  • No external API keys are needed to run the test suite
  • Sensitive data (API keys, tokens) is automatically redacted from recordings