Improve backend test coverage and add coverage tooling#35
Merged
Conversation
- Add coverage>=7.4 to dev dependencies (pyproject.toml, requirements.txt) - Add 18 new backend tests for low-coverage modules - Improve api_interpreters.py coverage: 29% → 60% (+31%) - Improve api_providers.py coverage: 20% → 33% (+13%) - Improve api_chat.py coverage: 34% → 37% (+3%) - Overall coverage: 67% → 68% New tests added: - test_chat_api.py: 7 new tests (GraphRAG endpoints, history, capabilities) - test_interpreters_registry_api.py: 4 new tests (toggle, debug endpoints) - test_providers_api.py: 6 new tests (provider roots, rclone validation) Coverage tooling: - Enables local coverage reports: python -m coverage run -m pytest - Interactive HTML reports: python -m coverage html (htmlcov/index.html) - Documentation added to dev/prompts.md Total: 197 tests passing (up from 179)
- Ignore .coverage file and .coverage.* parallel mode files - Ignore htmlcov/ directory (HTML coverage reports) - Ignore coverage.xml and *.cover files
- Add monkeypatch to mock shutil.which for rclone tests - Fixes CI failure where rclone is not installed - Tests now properly validate input validation logic - All 9 provider tests passing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
coverage>=7.4to dev dependencies for local coverage testingdev/prompts.mdCoverage Improvements
New Tests Added
test_chat_api.py (+7 tests)
test_api_chat_missing_message- Validates error handlingtest_api_chat_history- Tests chat history endpointtest_api_chat_capabilities- Tests capabilities endpointtest_api_chat_graphrag_disabled_by_default- Tests GraphRAG disabled statetest_api_chat_graphrag_missing_message- Tests GraphRAG error handlingtest_api_chat_context_refresh_disabled- Tests context refresh disabledtest_api_chat_observability_graphrag- Tests observability endpointtest_interpreters_registry_api.py (+4 tests)
test_api_interpreters_effective_debug- Tests debug endpointtest_api_interpreters_toggle_enable- Tests enabling interpreterstest_api_interpreters_toggle_disable- Tests disabling interpreterstest_api_interpreters_toggle_default_enabled- Tests default toggle behaviortest_providers_api.py (+6 tests)
test_provider_roots_default- Tests default provider rootstest_provider_roots_specific_provider- Tests specific provider querytest_provider_roots_invalid_provider- Tests error handlingtest_rclone_mounts_list- Tests mount listingtest_rclone_mounts_create_missing_rclone- Tests rclone validationtest_rclone_mounts_create_missing_remote- Tests remote validationtest_rclone_mounts_create_missing_name- Tests name validationCoverage Tooling
Added to dependencies:
coverage>=7.4inpyproject.tomlandrequirements.txtLocal usage:
Documentation:
dev/prompts.mdRemaining Low Coverage Areas
Future work to reach 70%+ overall:
api_files.py(37%) - Complex file operationslink_service.py(40%) - Preview/execute workflowsapi_graph.py(42%) - Graph query endpointslabel_service.py(50%) - Label CRUD operationsTest plan
🤖 Generated with Claude Code