Commit Graph

31 Commits

Author SHA1 Message Date
Connor Peet
fa9255c0de almost complete update for run configurations 2021-07-12 17:28:01 -07:00
Connor Peet
9a09d4817d testing: add test configurations api 2021-07-12 09:45:21 -07:00
Connor Peet
9044b2c162 testing: fix duplicated test items if ext host restarts
Fixes #128341
2021-07-09 12:56:02 -07:00
Connor Peet
45eea1f87b testing: initial api side of test coverage
For https://github.com/microsoft/vscode/issues/123713
2021-06-25 12:58:04 -07:00
Connor Peet
186e565ec0 refactor: update to new testing API
Previously in the testing API, you called `registerTestProvider` with
your own instance of a TestController, and VS Code would request
workspace or document tests. This has been changed: now, you call
`createTestController`, which returns an object, and call
`createTestItem` to insert test nodes under the `controller.root`.

Extensions should generally decide themselves when to publish tests. For
example, when a file is opened in an editor, test extensions will want
to make sure tests for that file are available so that inline
decorations can be shown. This is pretty similar to what the editor
API does in diagnostics.

There is still a `resolveChildrenHandler` on the controller (rather than
the TestItem directly), which you should _set_ if the test extension
supports lazy discovery. Additionally, if you support running tests,
you'll also want a `runHandler` (migrating from the old `runTests` method).

Some of the existing test providers have been updated, you can check
them out here:

- https://github.com/microsoft/vscode-extension-samples/tree/main/test-provider-sample
- https://github.com/microsoft/vscode-selfhost-test-provider

In summary, to update to the new API:

- Call `vscode.test.createTestController` instead of `registerTestController`
- Move the contents of your `runTests` method to `controller.runHandler`
- Move your `TestItem.resolveHandler` to `controller.resolveChildrenHandler`,
  which may involve adding some `instanceof` checks.
- If you lazily discovered tests in `createDocumentTestRoot`, you'll want
  to trigger that logic based on `vscode.workspace.onDidOpenTextDocument`.
- If your test runner can deal with showing locations of unsaved changes,
  listen for `vscode.workspace.onDidChangeTextDocument` to trigger those
  changes in the tree.
2021-06-21 12:14:24 -07:00
Connor Peet
ec65867a75 testing: improve cancellation, and allow test runs to be individually cancelled
Fixes #125712
2021-06-14 16:46:03 -07:00
Connor Peet
bb3ea733de testing: rework running side to new apis 2021-04-16 16:40:01 -07:00
Connor Peet
bec017d389 testing: rework discovery side of testing to new apis 2021-04-14 17:10:46 -07:00
Connor Peet
1f3acad632 testing: polish up test output terminal handling
Fixes https://github.com/microsoft/vscode/issues/119642
2021-04-12 12:22:09 -07:00
Connor Peet
6b666279b8 wip 2021-04-09 17:46:21 -07:00
Matt Bierner
e1f0f8f513 Add override keyword in codebase (#120755)
For #120675

This uses a script to add the override keyword to places that need it in the codebase

Note that we can't enable the --noImplicitOverride setting yet since there are still around 200 errors that require further attention
2021-04-08 10:05:20 -07:00
Connor Peet
8d57595fe8 testing: store results in separate files to fix ui slowness with large results 2021-04-05 12:14:34 -07:00
Connor Peet
ade3e6e683 testing: some api polishing
Fixes #119793
Fixes #119831
Fixes #117602
2021-04-01 15:43:24 -07:00
Connor Peet
cd31f2cdfa testing: fix test appearing on first line, remove location from TestItems
Fixes #119634
2021-03-24 12:54:19 -07:00
Connor Peet
808266d4de Allow tests to be loaded asynchronously (#119537)
* initial wip in the extension host

* wip

* wip

* wip

* continued progress

* update api from discussion

* update for new proposal

* wip

* update to lastest testing api, almost everything working

Refs https://github.com/microsoft/vscode/issues/115089
Design https://gist.github.com/connor4312/73f1883d720654834b7fd40550d3b6e0

* re-wire retirement state

* update actions to new async test structure

* minor cleanup

* remove unused es2018 that failed build
2021-03-22 18:08:13 -07:00
Connor Peet
edc4abbc53 testing: fix MainThreadTesting disposable fishiness
Fixes https://github.com/microsoft/vscode/issues/117380
2021-02-23 08:57:50 -08:00
Connor Peet
5a0bf3751a testing: add method to publish extension-provided results 2021-02-18 17:33:24 -08:00
Connor Peet
b09a71dce7 testing: update test results api to spec
Refs https://github.com/microsoft/vscode/issues/107467#issuecomment-780776814
2021-02-17 16:34:01 -08:00
Connor Peet
a0e0324a8d testing: commands to run tests at current cursor and in file
Refs https://github.com/microsoft/vscode/issues/116589
2021-02-12 16:09:18 -08:00
Connor Peet
c36a09929c testing: implement retired test state
Fixes https://github.com/microsoft/vscode/issues/115086
2021-02-10 15:34:42 -08:00
Connor Peet
3d4cabb608 testing: refactor to new runState API
Fixes: https://github.com/microsoft/vscode/issues/115101.
See issue for details.

- Adopts the new API
- Test results now persist across reloads (last 64 runs).
- Removed state grouping in favor of sorting option.
- Code lenses are disabled for now
2021-02-09 16:12:37 -08:00
Connor Peet
bd7dff7f07 testing: add test result to proposed api, ids for correlation 2021-01-25 12:20:28 -08:00
Connor Peet
686cd7df53 testing: clean up actions, add run/debug all, rm duplication
The WorkspaceTestCollectionService duplicated collection logic
unnecessarily. Centralize to the TestService's collection.

This also moves the state updates for discovering tests, and a new
update for adding roots, into the diff, which lets us synchronize those
changes with the changes to test collections.

There's a super crazy bug with the "run all" action that I have
not dove into yet.
2021-01-19 17:44:02 -08:00
Connor Peet
04efea43fa testing: peek diff test outputs 2021-01-12 12:57:42 -08:00
Connor Peet
01089c0a50 testing: fix unit tests 2021-01-06 15:35:20 -08:00
Connor Peet
e2c9137841 testing: fix unit tests 2021-01-06 15:32:50 -08:00
Connor Peet
5909115757 testing: code lens and diagnostic information for tests 2021-01-06 15:22:49 -08:00
Connor Peet
2c5c0a3be1 testing: fix loading indicators, add progress during initial test discovery 2021-01-05 13:02:58 -08:00
Connor Peet
cf94178b89 testing: improved test explorer, cancellation 2020-12-16 17:13:35 -08:00
Connor Peet
a9bf16e001 testing: base test explorer 2020-12-11 15:15:44 -08:00
Connor Peet
d1280418d7 testing: initial api implementation
* wip

* wip

* wip

* wip

* wip

* wip
2020-11-20 08:31:35 -08:00