Introduces a full test suite under the tests/ directory, including API, service, connector, and utility tests, along with fixtures and documentation. Expands Makefile with granular test commands for unit, integration, API, service, connector, coverage, and quick tests. Adds configuration files for pytest and coverage reporting, and provides a quickstart guide for testing workflow.
1.4 KiB
1.4 KiB
Testing Quick Start Guide
Run Tests
# All unit tests (fastest - recommended for development)
make test-unit
# All tests
make test
# With coverage report
make test-coverage
open htmlcov/index.html
# Specific category
make test-api
make test-service
make test-utils
# Verbose output
make test-verbose
# Re-run only failed tests
make test-failed
Test Structure
tests/
├── api/ - API endpoint tests
├── services/ - Business logic tests
├── utils/ - Utility function tests
├── connectors/ - Connector tests
├── config/ - Configuration tests
└── fixtures/ - Reusable test fixtures
Current Status
✅ 77 passing unit tests ✅ ~2 second runtime ✅ No mocks - using real fixtures ✅ Ready for CI/CD
Quick Commands
| Command | Description |
|---|---|
make test-unit |
Fast unit tests |
make test-integration |
Tests requiring OpenSearch/Langflow |
make test-coverage |
Generate coverage report |
make test-api |
API tests only |
make test-service |
Service tests only |
make test-quick |
Quick unit tests, no coverage |
Adding New Tests
- Create file:
tests/category/test_feature.py - Use markers:
@pytest.mark.unitor@pytest.mark.integration - Use fixtures from
conftest.py - Run:
make test-unit
See tests/README.md for detailed documentation.