Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: cargo test --workspace --all-features

vscode-extension:
name: VS Code Extension (E2E)
name: VS Code Extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -90,8 +90,11 @@ jobs:
- name: Install extension dependencies
run: npm --prefix extensions/vscode ci

- name: Run extension tests (includes DAP E2E)
run: npm --prefix extensions/vscode test
- name: Run extension smoke tests
run: npm --prefix extensions/vscode run test:smoke

- name: Run extension DAP E2E tests
run: npm --prefix extensions/vscode run test:dap-e2e

lint:
name: Lint (Clippy & Format)
Expand Down
11 changes: 10 additions & 1 deletion extensions/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,21 @@ npm run vscode:prepublish
│ └── cli/
│ └── debuggerProcess.ts # CLI process wrapper
│ ├── test/
│ │ └── runTest.ts # Extension smoke test
│ │ ├── runSmokeTest.ts # Smoke test entrypoint
│ │ ├── runDapE2E.ts # DAP end-to-end entrypoint
│ │ ├── runTest.ts # Combined compatibility wrapper
│ │ └── suites.ts # Shared test suite helpers
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
└── README.md # This file
```

### Running Tests

- `npm test` runs the smoke suite and the DAP end-to-end suite sequentially.
- `npm run test:smoke` runs the smoke checks only.
- `npm run test:dap-e2e` runs the DAP adapter end-to-end suite only.

## Contributing

We welcome contributions! Please:
Expand Down
5 changes: 4 additions & 1 deletion extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile",
"test": "node ./dist/test/runTest.js",
"test": "npm run test:smoke && npm run test:dap-e2e",
"test:all": "node ./dist/test/runTest.js",
"test:smoke": "node ./dist/test/runSmokeTest.js",
"test:dap-e2e": "node ./dist/test/runDapE2E.js",
"build": "npm run compile"
},
"devDependencies": {
Expand Down
35 changes: 18 additions & 17 deletions extensions/vscode/src/cli/debuggerProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,24 +223,25 @@ export class DebuggerProcess {
const port = this.config.port ?? await this.findAvailablePort();
this.port = port;

if (shouldSpawnServer) {
const child = spawn(binaryPath as string, this.buildArgs(port), {
stdio: ['ignore', 'pipe', 'pipe'],
env: {
...process.env,
...(this.config.trace ? { RUST_LOG: 'debug' } : {})
}
});
this.childProcess = child;
try {
if (shouldSpawnServer) {
const child = spawn(binaryPath as string, this.buildArgs(port), {
stdio: ['ignore', 'pipe', 'pipe'],
env: {
...process.env,
...(this.config.trace ? { RUST_LOG: 'debug' } : {})
}
});
this.childProcess = child;

child.once('exit', () => {
this.rejectPendingRequests(new Error('Debugger server exited'));
this.socket?.destroy();
this.socket = null;
});
} else if (!this.config.port) {
throw new Error('DebuggerProcessConfig.port is required when spawnServer is false');
}
child.once('exit', () => {
this.rejectPendingRequests(new Error('Debugger server exited'));
this.socket?.destroy();
this.socket = null;
});
} else if (!this.config.port) {
throw new Error('DebuggerProcessConfig.port is required when spawnServer is false');
}

try {
await this.waitForServer(port);
Expand Down
6 changes: 6 additions & 0 deletions extensions/vscode/src/test/runDapE2E.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { runDapE2ESuite } from './suites';

runDapE2ESuite().catch((error) => {
console.error(error);
process.exit(1);
});
6 changes: 6 additions & 0 deletions extensions/vscode/src/test/runSmokeTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { runSmokeSuite } from './suites';

runSmokeSuite().catch((error) => {
console.error(error);
process.exit(1);
});
Loading
Loading