Skip to content

Commit 63a8ccc

Browse files
docs: add remaining work tracking for Issue #487
Document the work completed and remaining tasks for full issue resolution: Completed (quick wins): - Fixed three correctness footguns - Added regression tests Remaining work: - Establish coverage baseline and restore to ~100% - Reduce mock usage in favor of integration tests - Address architecture/quality follow-ups - Document testing patterns This provides a roadmap for continuing the coverage and testing improvements. Related to #487 Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com> Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
1 parent bb364dc commit 63a8ccc

1 file changed

Lines changed: 100 additions & 0 deletions

File tree

‎docs/issue-487-remaining-work.md‎

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Issue #487 Remaining Work
2+
3+
This document outlines the remaining work for Issue #487 after the quick wins have been addressed.
4+
5+
## ✅ Completed (Quick Wins)
6+
7+
1. **Fixed mutable default args** in `search_notes()` MCP tool
8+
2. **Fixed Pydantic defaults** in `WatchServiceState` classes
9+
3. **Fixed list mutation during iteration** in `WatchService.handle_changes()`
10+
4. **Added regression tests** for all three bugs
11+
12+
## 🔄 Remaining Work
13+
14+
### 1. Coverage Baseline and Restoration
15+
16+
**Goal**: Restore test coverage to ~100% (practical: minimal, justified excludes)
17+
18+
**Tasks**:
19+
- [ ] Run `just coverage` to establish current baseline
20+
- [ ] Identify files/functions with missing coverage
21+
- [ ] Add tests for uncovered code paths
22+
- [ ] Document any justified coverage excludes (e.g., CLI entry points, debug code)
23+
24+
**Priority**: High - This is the main goal of the issue
25+
26+
### 2. Reduce Mock Usage
27+
28+
**Goal**: Replace mocks with integration tests where practical
29+
30+
**Tasks**:
31+
- [ ] **High-value targets** (most mocked files):
32+
- `tests/test_rclone_commands.py` (56 mocks) - Consider using real rclone or temp dirs
33+
- `tests/sync/test_sync_service.py` (11 mocks) - Many can use real filesystem
34+
- `tests/services/test_search_service.py` (8 mocks) - Already mostly integration-style
35+
36+
- [ ] **Cloud/external service mocks**:
37+
- `tests/cli/test_cloud_authentication.py` - Consider mock OAuth server or test fixtures
38+
- `tests/cli/test_upload.py` - Consider using MinIO (local S3-compatible storage)
39+
- `tests/test_telemetry.py` - Mock external telemetry endpoint is acceptable
40+
41+
- [ ] **Move appropriate tests to `test-int/`**:
42+
- Tests that use real DB + real filesystem + real in-process API client belong in `test-int/`
43+
- Keep unit tests in `tests/` for isolated component testing
44+
45+
**Priority**: Medium - Important for test reliability but not critical
46+
47+
### 3. Architecture/Quality Follow-ups
48+
49+
**Tasks**:
50+
- [ ] **Cloud-mode DB initialization**: Ensure cloud mode runs required DB init/migrations reliably
51+
- Even if project reconciliation is skipped
52+
- Add integration test for cloud mode startup
53+
54+
- [ ] **Telemetry credential optics**: Review client secret in repo
55+
- Currently marked as "write-only" but still in version control
56+
- Consider environment variable or config file approach
57+
- Document security model if keeping in repo
58+
59+
**Priority**: Medium - Quality improvements, not bugs
60+
61+
### 4. Documentation
62+
63+
**Tasks**:
64+
- [ ] Document coverage expectations in CLAUDE.md or CONTRIBUTING.md
65+
- [ ] Document when to use mocks vs integration tests
66+
- [ ] Add examples of good integration tests to test guidelines
67+
68+
**Priority**: Low - Nice to have
69+
70+
## Testing Strategy
71+
72+
### Unit Tests (`tests/`)
73+
- **Use when**: Testing isolated components with clear boundaries
74+
- **Mock**: External services, network calls, filesystem (when appropriate)
75+
- **Examples**: Schema validation, utility functions, parsers
76+
77+
### Integration Tests (`test-int/`)
78+
- **Use when**: Testing user flows, API endpoints, sync operations
79+
- **Real components**: Database (SQLite/Postgres), filesystem (tmp_path), in-process API client
80+
- **Examples**: MCP tool workflows, sync operations, search functionality
81+
82+
### Coverage Goals
83+
- **Target**: ~100% practical coverage
84+
- **Acceptable excludes**: CLI entry points, debug code, unreachable error paths
85+
- **Document**: All coverage excludes with justification
86+
87+
## Next Steps
88+
89+
1. **Run coverage baseline**: `just coverage` (requires approval)
90+
2. **Triage uncovered code**: Identify what needs tests vs what can be excluded
91+
3. **Prioritize high-value tests**: Focus on user-facing functionality first
92+
4. **Reduce strategic mocks**: Start with `test_rclone_commands.py`
93+
5. **Document patterns**: Add testing guidelines to help future contributions
94+
95+
## References
96+
97+
- Issue: #487
98+
- Quick wins commits: [cdc28ee](https://github.com/basicmachines-co/basic-memory/commit/cdc28ee), [bb364dc](https://github.com/basicmachines-co/basic-memory/commit/bb364dc)
99+
- Test structure: `tests/` (unit), `test-int/` (integration)
100+
- Coverage tool: `just coverage` → `coverage/index.html`

0 commit comments

Comments
 (0)