-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Test Runner Viewlet with an Extension API to plug into [Enhancement Request] #9505
Comments
Few ideas, all just IMHO, may be totally wrong ;) I believe that test adapters should have their separate extension point just like debuggers. Also creating nice, lightweight UI (as described above) would be really great, there is enough place on left panel for one more button ;) From the API point of view I think we would need:
Buttons to run all tests / selected tests / single test / previously not passed tests etc. would all execute function 3. just with appropriate list of tests based on chosen command, selection in UI, and previous result category.
Basic run options could be easily handled by VSCode (as I've described earlier). Getting API for providing custom options / list could be nice but it's definitely not necessary for initial implementation
It's possible to execute start debugging using Open question, should it be defined by test adapter creator or by end user?
I'd say so - probably just for sake of lazy extension activation. If language supported by test adapter appears in current workspace active test runner.
That's actually really interesting case, for most APIs right now VSCode decide when to recalculate things and call implemented API again.
I'd like to see something similar to debug case where we have dropdown to select different debugging configurations - different configs specified in |
As an alternative, I find TestDriven's unit-testing experience much better than that of built-in VS or as offered by R#. Personally, I don't need a separate test browser, nor a new output window. I'm already looking at the code and if the plugin can receive which line the cursor is on then it can tell wether I want to run the whole suite or the specific test. For everything else there's always a task and since it can also write to the output window the transition is seamless. |
Thanks for the input and it is great to see the different perspectives. First, test running is an Rather than starting with the maximum number of features that could be added say to a test explorer, what would be the minimum features to still provide a good developer experience. e.g., navigate from failure traces to the code, seeing an indication of the number of the test failures. Consider the test runners you are using today, would a command line version for them be sufficient? |
@egamma I wanted to make a strong opening bid 😉 |
I guess I would like to see following set of feature:
Also, having test viewlet, wouldn't break current command line based workflows, so that's just added value 😉 |
Just adding how some extensions are now supporting unit testing. @alexandrudima fyi PythonGo
|
@egamma if several extensions are starting to implement a common set of features to provide functionality that users clearly want, all of which falls within a set of reoccurring abstract constructs, it seems like the perfect opportunity for vscode to provide a standard API to facilitate this so every language extension doesn't need to roll a bespoke implementation 😸 |
@cloudRoutine yes, this is exactly the plan. |
Any update on this..? |
It would be useful if the .runsettings file functionality could be included. |
A extension that can access the Activity Bar could speed up the initial implementation by the community. Is it possible for extension to add activity bar items? i wasn't able to find it... https://github.com/Microsoft/vscode-extension-samples/blob/master/tree-explorer-sample/USAGE.md |
This is the feature that would be the biggest improvement for me in my VS Code experience. Right now I'm running tests with a command-line runner and manually finding the failing test by a Ctrl+F search on the test names. Having a way to jump to the failing test, and (as a bonus) to see the console output of that specific test in the test output window, would improve my VS Code experience quite a bit. So I'll echo the "Any update on this?" request from last December. This is my most-wished-for feature in VS Code right now, and I think testing is worthy of its own dedicated icon on the Activity Bar, with shortcut Ctrl/Cmd + Shift + T. (Or fallback shortcut Ctrl/Cmd + Shift + U, for "Unit testing", if Ctrl/Cmd + Shift + T is already taken). |
Please please please |
The VS test runner is the most awful thing I've ever seen. Please don't even look at it for ideas. Look at Rider's (or R#) test explorer and session runner instead, it's a piece of art, really. |
It's almost a year now. Is there any news on this? Maybe just some comment like "It's on the roadmap for 201x" or "No, we don't want to implement this now, because..."? |
@vasily-kirichenko What about posting some screenshots here so it's easier to follow your suggestion. |
@realvictorprm are u gonna implement it? if so, install rider and play with the test runner. |
Based on lack of any updates from the maintainers, it feels like the community has to drive it, if we want to have it any time soon. Obviously enough, we want a common infrastructure in VSCode, and adapters to different platforms/tools/frameworks. This is quite a big task though. I'd prefer moving step by step, and not trying to provide a complete solution right off. I personally need integrated unit testing experience for .NET Core C# projects, so I'm thinking of these tactical steps:
|
This feature is still on our roadmap and we want to better support test running to complete the inner loop of development. Today, there are already many extensions that support test running. Our plan is to start by analyzing these extensions and then to come up with APIs and UIs that unifies the experience for the user and the test runner implementors. It is too early to tell whether this will be a general test adapter API or just a smaller building block like a |
Please don't rely too much on the existing testing extensions - they're a poor mans set of test runners. Check out ReSharpers support for unit testing. The lack of a test explorer leaves a painful hole when coding with vscode https://www.jetbrains.com/resharper/features/unit_testing.html |
A work in progress test extension is published here: https://github.com/gfrancischini/vscode-unit-test The idea is to reuse the vstest framework to be able to run any test framework that run inside Visual Studio Test Explorer. |
In #9505 (comment), @egamma wrote:
However, it no longer appears on the 2018 roadmap. Has it been dropped from consideration? Should extensions start implementing their own ad-hoc test views, rather than wait for VS Code to provide this? Or is it still on the roadmap, but the wiki just hasn't been brought up-to-date yet? |
@rmunn we did an investigation of the existing Test Running extensions during the last planning period (we should have updated the issue with the findings sorry). We have discovered a lot of creativity with regard to Test Running extensions. After this investigation we came to the conclusion that trying to come up with some basic Test Running infrastructure in the VS Code core would not add a lot of value and could be more constraining. Finally our users seem to be happy with the current test extensions. For this reason we did not add it to the 2018 roadmap. This doesn´t mean that it will never come back and we will continue watching and listening in this space. |
This is kinda disappointing for two reasons:
I know Code doesn't want to be an IDE, but tests seems like one of the most important things that most projects don't do well (software complexity is only increasing and quality seems to be decreasing). Having good built-in test functionality could make a real difference. |
Hi, we need this! The existing extensions are a desperation attempt to fix something you should have fixed a long time ago. There needs to be a unified place where I can see all the tests from different plugins for test frameworks. Then a test framework maintainer can just provide a plugin and the test Tab could show an aggregation. Now there is no place where I can see both .net and js tests at the same place. We are definitely not happy with them. This feature seems like a no-brainer and not too difficult to engineer. |
If as @egamma points out, there's a lot of variation between the different test runners, then it might make some sense to hold off on implementing this API for a while. However, I'd like to request one feature be implemented now, at least: adding a new sidebar view (and icon) for unit testing extensions to use. Currently the API only allows extensions to add tree views to the explorer or debug sidebars, which means that unit test extensions like https://github.com/gfrancischini/vscode-unit-test have to either use the debug sidebar (which doesn't feel appropriate) or the explorer sidebar (which is already overloaded, with three panels — open editors, folder view, and bookmarks — opened by default, and that's not counting any other panels that other extensions might add). I'd much rather see a sidebar view, with its own icon, made available for unit test extensions to use. Here's a mockup of what it could look like: The icon could, of course, be anything: I just picked something that seemed appropriate (in this case, an icon from https://icons8.com/icon/6258/checked with a free license). As someone else has already mentioned in the thread, unit testing is one of the things that feels fundamental to the concept of "a text editor for programmers". I know you want to avoid sidebar-icon proliferation, but unit testing is one of the things that's so core to the coding experience that I believe it truly deserves its own sidebar icon. General question: would you prefer me to open a new issue to track this "new sidebar icon for unit testing" idea, or should it be tracked here as a subset of this issue? |
#43645 appears to be related to my request for a new sidebar icon for test runner extensions to use. |
Sounds like a good start |
Let's not confuse variation with inconsistency. Currently people are left to implement it themselves with no guidelines, so of course they'll all be different. Visual Studio has a Test window which, while not perfect, has served many languages and frameworks reasonably well. VS Code has a good process for suggesting (and later implementing) proposed APIs to get feedback. I don't see why this wouldn't work well here. Propose something, and let all the people that want this (of which there are many) provide feedback if it won't fit their needs. |
FYI: I have just published a Test Explorer extension that is trying to fill this gap. This extension can be used by other extensions (called Test Adapters) to show and run the tests for a particular testing framework. I have also published a Test Adapter extension for Mocha and I'm working on another one for Jasmine. |
Agreed, and I also find useful to have a "show output" option. |
Will there be more news on this please? |
We are starting to investigate this here 👉 #107467 |
/duplicate of the linked issue |
In response to Erich Gamma's tweet @Krzysztof-Cieslak
A test runner viewlet/sidebar with a pluggable API would be a great addition to vscode.
The viewlet should include visual indications of
not run | success | failure | ignored/skipped
The test runner should be able to provide a set of sorting categories and repopulate the viewlet based on the users selection
A query box with the ability to filter the tests based on the names shown in the runner's list at a minimum, with the ability for the underlying runner to populate a set of query filters.
Instead of the VS style of collapsing categories
I think the vscode style used in the debugger viewlet is much nicer 😄
A button could be used to select which test runner you want to use out of the test runner extensions that have been installed
But a dropdown menu would work too
A side button to open a menu could enable the active test runner to populate it with any additional commands specific to its functionality
Some other functionality points -
The text was updated successfully, but these errors were encountered: