question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fast source-based test discovery with OmniSharp

See original GitHub issue

Guys, kudos for taking on the challenge! If you’re aimed at creating an excellent testing experience in VS Code, I’d like to join.

After passing through the code, here is my two cents. Running dotnet test for test discovery will be slow for seriously-sized projects. The UX will be identical to that of Visual Studio test runner, which is not that wonderful compared to ReSharper, IMHO.

According to a research I did earlier, OmniSharp server is capable of scanning source file contents, and providing a list of features on each method. Specifically, we’re going to look for XunitTestMethod, and maybe NUnitTestMethod in the future. (See this PR).

We can spin up background discovery for entire project/solution, as soon as we detect that .NET Core project/solution is loaded. We can re-scan the active file as it is being edited.

Discovery based on source code can also bring me the tests even if my code doesn’t compile - at least it will allow exploring and navigating the code. In Visual Studio test runner, the entire solution must be compiled before test discovery can start, so that it sometimes takes more than a minute to see my tests - this one is definitely a UX killer.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:16
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
janakacommented, Aug 15, 2018

Not got to that yet. Curious why you picked 10,100 as a number 😃. Definitely something to test out though.

Even if it’s the perf is the same as the cli approach, at present I feel depending on a versioned API/protocol is a more solid than a cli + reporting format that aren’t strictly versioned from what I understand. Might be wrong on that though.

0reactions
stefanforsbergcommented, Aug 14, 2018

Do we have any hard data on how much faster a discovery of say 10,100 and a 1000 tests would be with the approach in #83?

Read more comments on GitHub >

github_iconTop Results From Across the Web

vs code Problems with C# extension, Some projects have ...
NET Framework). The most common solution is to make sure Mono is installed on your machine (https://mono-project.com/download/) and that ...
Read more >
.NET Core Test Explorer - Visual Studio Marketplace
Extension for Visual Studio Code - Test Explorer for .NET Core (MSTest, xUnit, NUnit)
Read more >
Run unit tests with Test Explorer - Visual Studio (Windows)
As you run, write, and rerun your tests, the Test Explorer displays the results in a default grouping of Project, Namespace, and Class....
Read more >
Interactive Unit Testing with .NET Core and VS Code
Figure 11: With OmniSharp installed, you can build C# projects in VS Code. Step 6: Add an XUnit Test Project and Create and...
Read more >
Microsoft introduces closed-source C# extension for VS Code
OmniSharp does not use the VS Code Language Server Protocol (LSP), a standard mechanism for supporting rich editor features, and the plan is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found