Add e2e adapter harness and restore webview build#65
Conversation
jhlagado
left a comment
There was a problem hiding this comment.
PR Review: Add e2e adapter harness and restore webview build
CI Status
FAILING - The e2e tests are being picked up by the regular yarn test run, but the vscode mock alias is only defined in vitest.e2e.config.ts.
Error:
Failed to load url vscode (resolved id: vscode) in src/debug/path-resolver.ts
Fix: Exclude e2e tests from the main vitest.config.ts:
// vitest.config.ts
test: {
exclude: ['tests/e2e/**', ...configDefaults.exclude],
}Or add the vscode alias to the main config (less clean).
Summary
This PR adds a DAP e2e test harness that exercises the full debug adapter lifecycle in-process. Good foundation for Phase 5 (test coverage).
Changes Reviewed
1. DAP Client (dap-client.ts - 200 LOC)
- Clean implementation of DAP protocol wire format
- Request/response with timeout handling
- Event waiting with predicate support
- Proper buffer management for streaming
2. Test Harness (adapter.e2e.test.ts - 130 LOC)
- In-process adapter via PassThrough streams
- Tests:
stopOnEntry, breakpoint hit, stack trace verification - Mock workspace setup via
vscode-mock.ts
3. Fixture (tests/e2e/fixtures/simple/)
- Minimal Z80 program (5 lines)
- Prebuilt artifacts (HEX, LST, d8dbg.json)
- Complete debug80.json config
4. Separate E2E Config (vitest.e2e.config.ts)
- Mocks vscode module via alias
- 20s timeout for adapter startup
- Separate test run:
yarn test:e2e:adapter
Architecture
tests/e2e/
├── adapter/
│ ├── adapter.e2e.test.ts # Test cases
│ ├── dap-client.ts # DAP protocol client
│ └── vscode-mock.ts # Minimal vscode stub
└── fixtures/
└── simple/ # Minimal test project
Stats
- 12 files changed
- +496 / -1 lines
Verdict
Ship it once the test exclusion is fixed. Solid e2e foundation.
|
Pushed fix for CI failure: exclude Local: |
Initialize protect/expand/shadow flags from SYS_CTRL so SYS_INPUT reflects protectOnReset and other latched bits.
|
Follow-up:
Local: |
Summary\n- add DAP e2e test harness with a simple fixture and prebuilt artifacts\n- align fixture paths and mock VS Code workspace to load sources correctly\n- restore webview sources and build script; align ESLint/TS config for webview\n\n## Testing\n- yarn test:e2e:adapter\n- yarn lint\n- yarn build\n