Skip to content

Memo: End to end coreclr xunit run and debug scenario

Troy Dai edited this page May 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.

Design: test deubgging (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 dotnet test command build test project and returns process start information for test runner to OmniSharp.
  7. The OmniSharp call debugger API to start the test runner with the process start information. (External dependency: https://github.com/Microsoft/vscode/issues/4615).
  8. The debugger starts the test and stop at the break point.