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

Replay Debugger: Debug Tests #946

Closed
ntotten opened this issue Sep 7, 2018 · 4 comments
Closed

Replay Debugger: Debug Tests #946

ntotten opened this issue Sep 7, 2018 · 4 comments
Labels

Comments

@ntotten
Copy link
Contributor

ntotten commented Sep 7, 2018

In order to more easily use the replay debugger we will expose an option to “Debug Tests” in addition to the current “Run Tests” options.

UX

The user starts on a test class opened in VS Code. They would set breakpoints of where they want to debug.

image 1

Today, on each test class we show the codelens Run All Tests and on test methods we show the option Run Test. This feature will change these codelens to provide two options in each case instead of one.

This would change the codelenes to the following.

@isTest
Run All Tests | Debug All Tests
public class MyTest { 

  Run Test | Debug Test
  static testMethod void foo() {
  }
  
}

When a user clicks either Debug All Tests or Debug Test. The Following happens:

  1. Debug Logging is enabled
  2. The test(s) are run
  3. The debug log associated with the test run is downloaded
  4. Replay debugger is started using the previously downloaded log

Note, we should skip the step where the debug log is shown and jump immediately to debugging the code. The debug log should never be shown when using this feature.

Warning: Breakpoints/Checkpoints
If a user clicks Debug All Tests or Debug Test and doesn't have a breakpoint or checkpoint set, we should show a confirmation dialog.

Message Text:
You are about to debug tests, but don't have any breakpoints or checkpoints set. You should set some before running this command.

Buttons:

  • Continue → proceeds to running and debugging the tests
  • Cancel → cancels the command, allowing the user to go back and set breakpoints

Configuration Option: Interactive Debugger
Because some users have purchased interactive debugger licenses, we should set a preference to use the interactive debugger when running tests instead of the replay debugger. The functionality would be the same, except it would happen in real-time.

Test Panel
The debug test(s) options should also be invokable from the test panel. Functionality is the same.

@ntotten ntotten transferred this issue from forcedotcom/salesforcedx-vscode Jan 28, 2019
@ntotten ntotten transferred this issue from another repository Jan 28, 2019
@ntotten ntotten added this to the Spring 19 milestone Jan 28, 2019
@ntotten ntotten removed this from the Spring 19 milestone Mar 21, 2019
@ralphcallaway
Copy link

this is a wonderful approach, very excited that this is potentially being prioritized, would greatly improved developer ergonomics :)

@ralphcallaway
Copy link

this same approach would extend very well to the "Execute Anonymous Apex With Editor Contents" command

regarding the breakpoints warning, if none have been set you might consider just having the debugger stop on the first line. it's a use case I often use. although less much less frequently then run to first breakpoint, so your proposed behavior of continuing to the first breakpoint if one is set makes a lot of sense. that said, does seem tricky to figure out if a breakpoint is in the code path or not ... if it's not that could be pretty confusing UX in that everything would run launch do a lot of work and then just be done

@sc5148
Copy link

sc5148 commented Apr 12, 2021

When is the planned release for this?

@smaddox-sf smaddox-sf added type:feedback Feedback for new features and removed type:feature labels Oct 19, 2021
@smaddox-sf
Copy link
Contributor

This has been delivered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants