Skip to content

Memo: End to end coreclr xunit run and debug scenario

Troy Dai edited this page Apr 27, 2016 · 8 revisions

Scenario

  1. User open a solution contains netcoreapp xunit project. Here's an Example.
  2. Set a break point in one test method.
  3. Right click the mouse on the test method (on signature or in the method body)
  4. Choose the "run and debug" option in the context menu.
  5. Editor start build and run the chosen test method.
  6. Debugger break at the break point previously set.

Implementation in VS Code

  1. When user right click on a method, editor send request to OmniSharp for test service information.
  2. The test service information (TSI) endpoint (new) in OmniSharp query the roslyn workspace base on the given cursor location to determine if the position can locate a test.
  3. The test method is found. Then the TSI respond the editor with information of this test method.
  4. When user pick the "run and debug" option in the context menu, editor sends request to OmniSharp's test service execution (TSE) endpoint.
  5. The TSE starts a dotnet test in design time mode. (Full dotnet test spec)
  6. The test runner is started and notifies TSE with the process id of the test process. After that it stops and waits for further command.
  7. The OmniSharp modify the launch.json to add configuration to attach to the runner.
  8. [External dependency] The OmniSharp starts the coreclr-debugger to attach to the test runner.
  9. [External dependency] The debugger notifies the OmniSharp that it has attached to the test runner.
  10. The OmniSharp notifies the test runner to start test execution. 11.The debugger will break into the code.