-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Support for continuous (autorun) tests #134941
Comments
For Pester Tests, currently I control this with a AutoRun setting, so it makes perfect sense to put it in profiles. One issue that has come up is, when autorunning, it is possible to save a file and commit with the test pane and test file closed, and have no idea what you changed just failed the test, there's no indicator in this situation Thoughts:
|
With this API, who is responsible for detecting test run trigger events? Is the implication that the extension should run tests on FS save or on editor text change? Also, what is the flow of the |
That's correct
Once when enabled |
This comment has been minimized.
This comment has been minimized.
I'm looking at implementing auto run right now and have a bit of trouble figuring out the best way. As it stands now, should I create a new run profile called continous or something, and simply never "return"? Then it can be cancelled by cancellation token? Edit: And for individual tests that I want to autorun I need to contribute a menu item to start such a run? This might work! I did like using test explorer ui, but it was difficult to code the auto run without duplicate runs since the extension and my adapter where fighting about whos in control. |
You still want to call TestController.createTestRun whenever you start running tests -- on file save, for example. Note that you can just |
Ok gotcha, it would be nice to have the auto run toggle in the test explorer somewhere, but I guess thats what this issue is about. I am a bit confused about the settings available for the testing feature concerning auto run. I guess that these settings currently do not have any effect? Edit: It would also be nice to have the auto run flag per-test as in the old UI, I did use that a bit. |
That's right |
I also implemented a similar item in Pester Tests that all centers around toggling a setting. |
Could we hide these features that fail silently until auto-run ships? |
How often this will get delayed again? |
Hello @connor4312 , If I understand correctly one can just select a run profile to "autorun" but cannot select a set of tests. What do you think? |
|
Yes I imagine for larger projects it would be nice to autorun at a particular scope to get "fast feedback" without waiting for all the other tests to run. |
I was under the impression that it might be possible to provide per-test coverage, so that we know what tests to run when a specific line of code is changed. |
This is up to extensions / test runners to provide. VS Code itself is not aware of your dependency tree or runtime environment. If the test runner you're working with generates per test coverage, that could be a reasonable way to figure out how to map code to tests. |
I think I found an issue: debugging my extension with the insider the "Test Output" is only:
instead of the one I generated. |
Thanks, will look at that. I have been out of office this month, so I will look to finalize this API (and clean up polish items as mentioned) in March |
If you'd like me to walk through how my particular integration is going, and we can check the weak points and strong points, let me know :) |
A popular feature in test runners is re-running tests automatically as source code changes. I this should consider recognizing API, since the UI will have several specific behaviors for this:
While the former can be done through existing extension APIs such as menu contributions, it may be worth having official UI for this to provide a consistent experience, especially when multiple types of tests (and therefore extensions) are present.
I think this can be implemented in a fairly straightforward way with the addition of a
supportsContinuousRun
on the profile, and a boolean indicator on TestRuns indicating whether they should be continuous. I prefer the term "continuous" over "auto run" since saying "this is a continuous test run" brings in the temporal nature that "this is an autorun" does not.API Proposal
The text was updated successfully, but these errors were encountered: