- Notifications
You must be signed in to change notification settings - Fork24
[WIP] Progress towards unit test coverage#533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Draft
jaggederest wants to merge14 commits intomainChoose a base branch fromjaggederest/claude_ai_testing
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Draft
Changes fromall commits
Commits
Show all changes
14 commits Select commitHold shift + click to select a range
8816fef
test: add comprehensive tests for api.ts functions
jaggederest62fbc18
WIP todo file
jaggederestb79b844
test: achieve 100% line coverage for api.ts
jaggederest2a166aa
test: add comprehensive test suite for api-helper.ts
jaggederest72e01b2
test: add comprehensive tests for commands.ts
jaggederest39959f8
test: achieve 93.44% coverage for extension.ts through refactoring
jaggederest31bdefd
test: add comprehensive tests for storage.ts
jaggederest628f39e
test: add comprehensive tests for workspacesProvider.ts
jaggederest780a510
fix: resolve workspacesProvider test failures and improve testability
jaggederestadc144b
docs: update TODO.md with condensed testing status and roadmap
jaggedereste638f58
feat: refactor remote.ts for testability and add comprehensive tests
jaggederest01246a1
test: add comprehensive tests for proxy.ts
jaggederest1afefc5
test: add comprehensive tests for inbox.ts and workspaceMonitor.ts
jaggederest36edebe
docs: update TODO.md with comprehensive coverage analysis and roadmap
jaggederestFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
7 changes: 4 additions & 3 deletionsCLAUDE.md
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
131 changes: 131 additions & 0 deletionsTODO.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# VSCode Coder Extension - Testing Status & Coverage Roadmap | ||
## Current Status ✅ | ||
**Test Infrastructure Complete:** 17/17 source files have test files | ||
**Total Tests:** 345 tests passing across 17 test files | ||
**Test Framework:** Vitest with comprehensive mocking infrastructure | ||
**Overall Line Coverage:** 70.43% (significant gaps remain) | ||
--- | ||
## Test Coverage Analysis 📊 | ||
### 🎯 **100% Coverage Achieved (4 files)** | ||
| File | Lines | Status | | ||
|------|-------|---------| | ||
| `api-helper.ts` | 100% | ✅ Perfect coverage | | ||
| `api.ts` | 100% | ✅ Perfect coverage | | ||
| `inbox.ts` | 100% | ✅ Perfect coverage | | ||
| `proxy.ts` | 100% | ✅ Perfect coverage | | ||
### 🟢 **High Coverage (90%+ lines, 5 files)** | ||
| File | Lines | Tests | Priority | | ||
|------|-------|-------|----------| | ||
| `workspaceMonitor.ts` | 98.65% | 19 | ✅ Nearly complete | | ||
| `sshConfig.ts` | 96.21% | 14 | ✅ Nearly complete | | ||
| `extension.ts` | 93.44% | 26 | 🔸 Minor gaps | | ||
| `featureSet.ts` | 90.9% | 2 | 🔸 Minor gaps | | ||
| `cliManager.ts` | 90.05% | 6 | 🔸 Minor gaps | | ||
### 🟡 **Medium Coverage (70-90% lines, 4 files)** | ||
| File | Lines | Tests | Key Gaps | | ||
|------|-------|-------|----------| | ||
| `storage.ts` | 89.19% | 55 | Error scenarios, file operations | | ||
| `sshSupport.ts` | 88.78% | 9 | Edge cases, environment detection | | ||
| `headers.ts` | 85.08% | 9 | Complex header parsing scenarios | | ||
| `util.ts` | 79.19% | 8 | Helper functions, path operations | | ||
### 🔴 **Major Coverage Gaps (< 70% lines, 4 files)** | ||
| File | Lines | Tests | Status | Major Issues | | ||
|------|-------|-------|---------|--------------| | ||
| **`remote.ts`** | **25.4%** | 17 | 🚨 **Critical gap** | SSH setup, workspace lifecycle, error handling | | ||
| **`workspacesProvider.ts`** | **65.12%** | 27 | 🔸 Significant gaps | Tree operations, refresh logic, agent handling | | ||
| **`error.ts`** | **64.6%** | 11 | 🔸 Significant gaps | Error transformation, logging scenarios | | ||
| **`commands.ts`** | **56.01%** | 12 | 🔸 Significant gaps | Command implementations, user interactions | | ||
--- | ||
## Next Steps - Coverage Improvement 🎯 | ||
### **Phase 1: Critical Coverage Gaps (High Priority)** | ||
#### 1. **`remote.ts` - Critical Priority** 🚨 | ||
- **Current:** 25.4% lines covered (Major problem!) | ||
- **Missing:** SSH connection setup, workspace lifecycle, process management | ||
- **Action:** Expand existing 17 tests to cover: | ||
- Complete `setup()` method flow | ||
- `maybeWaitForRunning()` scenarios | ||
- SSH config generation and validation | ||
- Process monitoring and error handling | ||
#### 2. **`commands.ts` - High Priority** 🔸 | ||
- **Current:** 56.01% lines covered | ||
- **Missing:** Command implementations, user interaction flows | ||
- **Action:** Expand existing 12 tests to cover all command handlers | ||
#### 3. **`workspacesProvider.ts` - High Priority** 🔸 | ||
- **Current:** 65.12% lines covered | ||
- **Missing:** Tree refresh logic, agent selection, error scenarios | ||
- **Action:** Expand existing 27 tests for complete tree operations | ||
#### 4. **`error.ts` - Medium Priority** 🔸 | ||
- **Current:** 64.6% lines covered | ||
- **Missing:** Error transformation scenarios, logging paths | ||
- **Action:** Expand existing 11 tests for all error types | ||
### **Phase 2: Polish Existing High Coverage Files** | ||
- **Target:** Get 90%+ files to 95%+ coverage | ||
- **Files:** `extension.ts`, `storage.ts`, `headers.ts`, `util.ts`, `sshSupport.ts` | ||
- **Effort:** Low (minor gap filling) | ||
### **Phase 3: Integration & Edge Case Testing** | ||
- **Cross-module integration scenarios** | ||
- **Complex error propagation testing** | ||
- **Performance and timeout scenarios** | ||
--- | ||
## Success Metrics 🎯 | ||
### **Completed ✅** | ||
- [x] **17/17** source files have test files | ||
- [x] **345** tests passing (zero flaky tests) | ||
- [x] **4/17** files at 100% line coverage | ||
- [x] **9/17** files at 85%+ line coverage | ||
### **Target Goals 🎯** | ||
- [ ] **70% → 90%** overall line coverage (primary goal) | ||
- [ ] **`remote.ts`** from 25% → 80%+ coverage (critical) | ||
- [ ] **15/17** files at 85%+ line coverage | ||
- [ ] **8/17** files at 95%+ line coverage | ||
--- | ||
## Recent Achievements 🏆 | ||
✅ **Test Infrastructure Complete** (Just completed) | ||
- Created test files for all 17 source files | ||
- Fixed workspacesProvider test failures through strategic refactoring | ||
- Added comprehensive tests for proxy, inbox, and workspaceMonitor | ||
- Established robust mocking patterns for VSCode APIs | ||
✅ **Perfect Coverage Achieved** (4 files) | ||
- `api-helper.ts`, `api.ts`, `inbox.ts`, `proxy.ts` at 100% coverage | ||
- Strong foundation with core API and utility functions fully tested | ||
--- | ||
## Priority Action Items 📋 | ||
**Immediate (Next Session):** | ||
1. 🚨 **Fix `remote.ts` coverage** - Expand from 25% to 80%+ (critical business logic) | ||
2. 🔸 **Improve `commands.ts`** - Expand from 56% to 80%+ (user-facing functionality) | ||
3. 🔸 **Polish `workspacesProvider.ts`** - Expand from 65% to 80%+ (UI component) | ||
**Secondary:** | ||
4. Fill remaining gaps in medium-coverage files | ||
5. Add integration test scenarios | ||
6. Performance and edge case testing | ||
**Target:** Achieve **90% overall line coverage** with robust, maintainable tests. |
6 changes: 5 additions & 1 deletionpackage.json
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
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.