You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Connector Mode API Test Suite provides comprehensive testing for ThemisDB when running in HTTP REST API mode. It validates all CRUD operations, multi-model queries, transactions, authentication, streaming, monitoring, and error handling across the full API surface.
Current live suite includes an end-to-end connector workflow for:
Document ingestion from docs/ via POST /v2/documents (NDJSON)
RAG request execution via POST /api/v1/llm/rag (when LLM/RAG endpoints are enabled)
LLM model loading + inference via POST /api/v1/llm/models/load and POST /api/v1/llm/inference (when model config is provided)
LoRA adapter training trigger via POST /api/v1/llm/lora/adapters
Tests auto-skip these LLM/LoRA stages when the runtime does not expose those endpoints or when required model parameters are not configured.
# 1. Clone repository (if not already done)cd~/projects/themisdb
# 2. Build test suite
cmake --build build-release --target test_connector_mode_api
# 3. Run tests with automatic server startup
bash scripts/run_connector_api_tests.sh
# 4. Or run against existing server
bash scripts/run_connector_api_tests.sh --skip-server
Windows (PowerShell)
# 1. Navigate to repository
cd C:\VCC\themis
# 2. Build test suite
cmake --build build-msvc-ninja-release --target test_connector_mode_api
# 3. Run tests with automatic server startup
.\scripts\run_connector_api_tests.ps1
# 4. Or run against existing server
.\scripts\run_connector_api_tests.ps1 -SkipServer
# 5. Optional: run with docs + model configuration for LLM/RAG/LoRA E2E
.\scripts\run_connector_api_tests.ps1 `-DocsDir .\docs `-ModelId llama-3.1-8b `-ModelPath .\models\llama-3.1-8b.gguf `-LoraBaseModel llama-3.1-8b
Connector E2E Environment Variables
The live connector tests use these variables:
THEMIS_CONNECTOR_TEST_HOST
THEMIS_CONNECTOR_TEST_PORT
THEMIS_CONNECTOR_TEST_TIMEOUT_MS
THEMIS_CONNECTOR_TEST_BEARER_TOKEN (optional)
THEMIS_CONNECTOR_TEST_DOCS_DIR (defaults to docs)
THEMIS_CONNECTOR_TEST_MODEL_ID (required for model-load/inference test)
THEMIS_CONNECTOR_TEST_MODEL_PATH (optional model path for load endpoint)
THEMIS_CONNECTOR_TEST_LORA_BASE_MODEL (required for LoRA training trigger if model id is not set)
# Include connector test suiteinclude(tests/CMakeLists_connector_tests.txt)
# Or build individuallyadd_executable(test_connector_mode_apitests/test_connector_mode_api.cpp)
target_link_libraries(test_connector_mode_apiPUBLICgtestgtest_mainnlohmann_json::nlohmann_jsoncpp_httplib::cpp_httplib
)
The provided scripts automatically start the server and run tests:
# Linux/macOS
./scripts/run_connector_api_tests.sh
# Windows PowerShell
.\scripts\run_connector_api_tests.ps1
Option 2: Manual Test Execution
# Terminal 1: Start server
themis_server --host 127.0.0.1 --port 8765 --data-dir ./test_db
# Terminal 2: Run tests
./build-release/bin/test_connector_mode_api
# Or with specific filters
./build-release/bin/test_connector_mode_api \
--gtest_filter="ConnectorCRUDTest.*"# Or run specific test
./build-release/bin/test_connector_mode_api \
--gtest_filter="ConnectorConnectionTest.HealthCheck"
Test Filtering Options
# Run only connection tests
--gtest_filter="ConnectorConnectionTest.*"# Run only CRUD tests
--gtest_filter="ConnectorCRUDTest.*"# Run all except error tests
--gtest_filter="-*ErrorHandling*"# Run specific test class
--gtest_filter="ConnectorQueryTest*"# Run tests matching pattern
--gtest_filter="*Latency*"
Output Formats
# Colored output (default)
./test_binary --gtest_color=yes
# Print test names
./test_binary --gtest_print_time=1
# XML output for CI/CD
./test_binary --gtest_output=xml:test_results.xml
# JSON output
./test_binary --gtest_output=json:test_results.json