Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DebugSessionOptions.testRun #13939

Merged
merged 3 commits into from
Jul 25, 2024

Conversation

tsmaeder
Copy link
Contributor

What it does

Adds the DebugSessionOptions.testRun field. The behavioral change associated with this is that a debug session that is started as part of test run will be terminated when the test run ends.

Fixes #13872

Contributed on behalf of STMicroelectronics

How to test

The attached plugin contributes a test controller with a single test.

  1. In the test explorer, click the "debug" icon on the line of the test
  2. Observe: a test run is started and a nodejs program associated with test is started in the debugger
  3. Select the test run in the test run view and choose "cancel test run" from the context menu
  4. Observe: the debug session is terminated.

Follow-ups

Review checklist

Reminder for reviewers

@tsmaeder
Copy link
Contributor Author

Here's the extension

testcontroller-0.0.1.zip

And here's the source code:

testcontroller-src.zip

Copy link
Contributor

@rschnekenbu rschnekenbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, it works as expected with the test extension.
Only a question and a minor change (console.log)

packages/debug/src/browser/debug-session.tsx Show resolved Hide resolved
@@ -62,7 +62,10 @@ export class TestRunViewContribution extends AbstractViewContribution<TestRunTre
override registerCommands(commands: CommandRegistry): void {
super.registerCommands(commands);
commands.registerCommand(TestViewCommands.CANCEL_RUN, {
isEnabled: t => TestRun.is(t) && t.isRunning,
isEnabled: t => {
console.log('is enabled');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a leftover from debugging?

Fixes eclipse-theia#13872

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
@tsmaeder tsmaeder merged commit 73d4b04 into eclipse-theia:master Jul 25, 2024
11 of 14 checks passed
@sgraband sgraband added this to the 1.52.0 milestone Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[vscode] Support DebugSessionOptions#testRun introduced in VS Code 1.91
3 participants