-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
priority-highHigh priority issuesHigh priority issuespythonPython language supportPython language supporttechnical-debtTechnical debt and code quality issuesTechnical debt and code quality issuestestingTesting infrastructure and test coverageTesting infrastructure and test coverage
Description
Priority: P1 - High
Problem Statement
New Python Phase 2/3 implementation spans 890 lines but test file is only 475 lines. Project requires 85-90%+ coverage; current ratio suggests insufficient testing for edge cases and error paths.
Missing Test Coverage
Edge Cases Needed
- Missing profiler tools - Test behavior when cProfile/py-spy/memray not available
- Error paths in venv deletion - Test when venv directory doesn't exist or has permission issues
- pyupgrade integration - Test actual pyupgrade output parsing
- Compatibility tool - Test vermin output parsing edge cases
- Security tool - Test when bandit/pip-audit not installed
- Build tool - Test missing build dependencies
Error Path Coverage
- Invalid directory paths
- Permission denied scenarios
- Malformed tool output
- Network failures for pip-audit
- Timeout scenarios for long-running profiling
Implementation Guidance
Files to Modify
src/__tests__/tools/python-tools.test.ts- Add comprehensive tests
Test Structure
describe('pythonProfile edge cases', () => {
it('handles missing cProfile gracefully', async () => {
// Mock command not found
});
it('validates script path exists', async () => {
// Test with non-existent script
});
it('handles profiler timeout', async () => {
// Test timeout behavior
});
});
describe('pythonVenv edge cases', () => {
it('handles deletion of non-existent venv', async () => {
// Test delete action when venv missing
});
it('handles permission denied on delete', async () => {
// Test permission error
});
});Acceptance Criteria
- Coverage ratio improved (target 85-90%+)
- All error paths tested
- Missing tool scenarios covered
- Permission and timeout edge cases tested
- Tests are fast and well-mocked (per CLAUDE.md standards)
-
make testpasses with improved coverage
References
- PR feat: complete Phase 2/3 Python tools - security, building, profiling… #249 review comment
- Related to Epic Epic: Python Language Support with Modern Tooling (pyright, ruff, uv, pytest) #131 (Python tools)
- Test quality standards in CLAUDE.md
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority-highHigh priority issuesHigh priority issuespythonPython language supportPython language supporttechnical-debtTechnical debt and code quality issuesTechnical debt and code quality issuestestingTesting infrastructure and test coverageTesting infrastructure and test coverage