Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 intomain
base:main
Choose a base branch
Loading
fromjaggederest/claude_ai_testing
Draft
Show file tree
Hide file tree
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
jaggederestJun 13, 2025
62fbc18
WIP todo file
jaggederestJun 13, 2025
b79b844
test: achieve 100% line coverage for api.ts
jaggederestJun 13, 2025
2a166aa
test: add comprehensive test suite for api-helper.ts
jaggederestJun 13, 2025
72e01b2
test: add comprehensive tests for commands.ts
jaggederestJun 13, 2025
39959f8
test: achieve 93.44% coverage for extension.ts through refactoring
jaggederestJun 13, 2025
31bdefd
test: add comprehensive tests for storage.ts
jaggederestJun 13, 2025
628f39e
test: add comprehensive tests for workspacesProvider.ts
jaggederestJun 13, 2025
780a510
fix: resolve workspacesProvider test failures and improve testability
jaggederestJun 13, 2025
adc144b
docs: update TODO.md with condensed testing status and roadmap
jaggederestJun 13, 2025
e638f58
feat: refactor remote.ts for testability and add comprehensive tests
jaggederestJun 13, 2025
01246a1
test: add comprehensive tests for proxy.ts
jaggederestJun 13, 2025
1afefc5
test: add comprehensive tests for inbox.ts and workspaceMonitor.ts
jaggederestJun 13, 2025
36edebe
docs: update TODO.md with comprehensive coverage analysis and roadmap
jaggederestJun 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletionsCLAUDE.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,9 +7,10 @@
- Package: `yarn package`
- Lint: `yarn lint`
- Lint with auto-fix: `yarn lint:fix`
- Run all tests: `yarn test`
- Run specific test: `vitest ./src/filename.test.ts`
- CI test mode: `yarn test:ci`
- Run all tests: `yarn test:ci` (always use CI mode for reliable results, runs all test files automatically)
- Watch mode (development only): `yarn test`
- Run tests with coverage: `yarn test:coverage`
- View coverage in browser: `yarn test:coverage:ui`

## Code Style Guidelines

Expand Down
131 changes: 131 additions & 0 deletionsTODO.md
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -279,7 +279,9 @@
"lint":"eslint . --ext ts,md",
"lint:fix":"yarn lint --fix",
"test":"vitest ./src",
"test:ci":"CI=true yarn test"
"test:ci":"CI=true yarn test",
"test:coverage":"vitest run --coverage",
"test:coverage:ui":"vitest --coverage --ui"
},
"devDependencies": {
"@types/eventsource":"^3.0.0",
Expand All@@ -291,6 +293,8 @@
"@types/ws":"^8.18.1",
"@typescript-eslint/eslint-plugin":"^7.0.0",
"@typescript-eslint/parser":"^6.21.0",
"@vitest/coverage-v8":"^0.34.6",
"@vitest/ui":"^0.34.6",
"@vscode/test-electron":"^2.5.2",
"@vscode/vsce":"^2.21.1",
"bufferutil":"^4.0.9",
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp