-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
vscode.TestObserver is an unusual API pattern #117379
Comments
The reasoning is that the test API is built to be lazy. We don't want to load tests, particularly tests for the workspace, unless there's someone listening to it -- in some cases (like Java) watching tests can be pretty expensive. There is also an optimization for the common case of documents: consumers can request test results for a single document, which can be used to provide decorations, code lenses, etc. This can often be much cheaper than watching the entire workspace for tests and changes. Both of these things are hard to express just given a TestItem array and change event. Also fyi, the test observer api is much rougher than the rest of the API and I do not plan to stabilize it under after the provider-related API is available |
Is that equal to opening the test view or to running some "run all tests" command? |
Both of those requires all tests to be enumerated, yea. Whereas running tests in a document -- through the various "current file" commands or by clicking a gutter decoration -- only requires tests for the document. |
I think there is a better understanding of the load demands around tests now 🙂 However I did simplify things in 4f4b3ca
The exposed APIs do not allow the same optimal paths that core leverages around tests, but in exchange it results in a much simpler and more standard API. |
This has become obsolete |
Testing #117307
So far, my understanding of
vscode.TestObserver
and its factory functions is that a test observer gives you access to tests, e.g it enumerates them and fires events when something changes. The usual API pattern for something like that doesn't use such an indirection but exposes things directly. So, I wonder why there isn't something like this insteadThe text was updated successfully, but these errors were encountered: