Commit Graph

79 Commits

Author SHA1 Message Date
Connor Peet
804dc2f7de testing: better approach to deserializing test items 2022-03-31 10:25:09 -07:00
Connor Peet
c39c600ff4 testing: fix comp error 2022-03-30 16:01:45 -07:00
Connor Peet
14a318068c testing: disentangle test item collection from exthost for use in tests
Fixes #141921
2022-03-30 14:57:46 -07:00
meganrogge
7610991b7d Revert "Revert "testing: fix profile id reuse not working""
This reverts commit e24d577022.
2022-03-02 22:28:04 -06:00
meganrogge
e24d577022 Revert "testing: fix profile id reuse not working"
This reverts commit 0f6d61a0d3.
2022-03-02 21:15:48 -06:00
Connor Peet
0f6d61a0d3 testing: fix profile id reuse not working 2022-03-02 16:08:25 -08:00
Connor Peet
29443c912f testing: fix rerun last not working for extension triggered runs
Fixes #144169
2022-03-02 16:08:25 -08:00
Johannes Rieken
daf029dfac extract marshalling id into its own file and untable uri from it, https://github.com/microsoft/vscode/issues/142476 2022-02-22 12:38:57 +01:00
Connor Peet
1e41d52904 testing: refactor to avoid complex object in ext host comms
For #140975
2022-02-07 15:37:02 -08:00
Johannes Rieken
4a130c40ed enable @typescript-eslint/member-delimiter-style, https://github.com/microsoft/vscode/issues/140391 2022-02-02 14:35:33 +01:00
Connor Peet
fb1eac3db7 testing: only reveal testing view for ui-triggered runs 2022-01-20 17:10:03 -08:00
Connor Peet
fe0e9a96d3 testing: allow canceling test refresh 2022-01-10 15:09:08 -08:00
Connor Peet
a87cdeaec7 testing: add refresh action
For #139737
2022-01-06 13:02:51 -08:00
Connor Peet
604dd1418f testing: fix run incorrectly ending if executed on multiple controllers
Fixes (#131827)
2021-08-30 15:37:44 -07:00
Connor Peet
f3fbecd1cc testing: fix setting states in a run with identical IDs not working
Fixes #131827
2021-08-30 15:37:44 -07:00
Connor Peet
d1e4e27c3a testing: default failure message to the test location if not already set
Fixes #131898
2021-08-30 15:37:44 -07:00
Connor Peet
03504d625a testing: support for test tags in search
This also involves creating a suggest enabled input with history, which
I modelled off the previous plain text input with history.
2021-08-12 17:16:32 -07:00
Connor Peet
fa8ccff4d8 testing: initial output correlation 2021-08-11 13:08:58 -07:00
Connor Peet
9125758184 testing: add support for test tags
For #129456
2021-08-09 16:31:23 -07:00
Connor Peet
472a308b03 testing: fix label not applying to root by default 2021-07-26 10:54:12 -07:00
Connor Peet
dfa9a4fa3f testing: add errored state 2021-07-23 16:45:20 -07:00
Connor Peet
38e09192c0 testing: api feedback 2021-07-21 15:20:12 -07:00
Connor Peet
cfc48e81aa testing: update api from feedback 2021-07-20 15:02:21 -07:00
Connor Peet
3f9af31b25 testing: update test types for feedback 2021-07-19 08:21:26 -07:00
Connor Peet
da7d92b8b1 testing: make test ids locally unique, instead of globally unique 2021-07-16 12:51:53 -07:00
Connor Peet
42c268a626 testing: clean up nits
- rename TestController.createRunConfiguration to .createRunProfile, and associated types
- rename TestItemCollection.remove to TestItemCollection.delete
2021-07-16 12:46:59 -07:00
Connor Peet
581ff12c39 testing: improve test children API
This changeset results from the discussion in and fixes #126987.
Migration for these changes should take about 15-20 minutes.

- `createTestItem` no longer takes a parent. Instead, it creates a free-
  floating test item, which can be added as a child of a parent.
- The `TestItem.children` is now a `TestItemCollection`, a set-like
  interface that also allows replacing items (intelligently diffing
	them internally) wholesale. This removes the need for the "generation
	counter" used in samples previously.
- There is no longer a `root` on the test controller, but instead an
  `items` property which is the same `TestItemCollection`
- The `tests` in the `TestRunRequest` has been replaced with an `include`
  property. If undefined, the extension should run all tests. (Since
	there is no longer a root to reference).

Here's some example migrations:

- 3fad3d66c1
- 3aff746316
2021-07-14 18:12:59 -07:00
Connor Peet
e4ac0cd64c testing: complete test run experience update
Fixes https://github.com/microsoft/vscode/issues/127096
2021-07-13 18:20:48 -07:00
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
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
6a76c62232 testing: remove data from TestItems
Data was viral and spread generics all over the place. It was also
hard to type correctly and consistently, which ended up in the type
being `any` unless great care was taken.

This removes the `data`. Instead, consumers can use a `WeakMap<TestItem, T>`
to keep data associated with the test item. This is a similar pattern
to what is used to store data about documents and debug sessions, for
example. Here's an example of a migration:

8fdf822985 (diff-2fe3ad6ad19447c57c5db14c5a6ccb5544944494db6b909540d70ea499784b49R9)
2021-06-24 12:02:49 -07:00
Connor Peet
fc0ee4e4bc testing: pass test item in context menu actions
Fixes #126646
2021-06-22 18:47:25 -07:00
Connor Peet
fe84fcfa65 testing: correctly no-op when running a test outside inclusions
Fixes #126756
2021-06-22 18:47:25 -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
3e0c442a8e testing: avoid duplicated calls to workspace root if document tests are not provided
Fixes #126290
2021-06-15 18:29:02 -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
478f95345c testing: fix error if a test state is updated synchronously on a detached test run
Fixes #126186
2021-06-14 16:46:02 -07:00
Connor Peet
64bd1fc65a testing: make uri optional 2021-05-06 11:46:44 -07:00
Connor Peet
37d967e30d testing: rename testRunTask to testRun 2021-04-26 10:24:19 -07:00
Connor Peet
c141ca6661 testing: show load errors in tree view
Fixes #117198
2021-04-22 12:58:57 -07:00
Connor Peet
4eee5c6ee5 testing: fix test wrapper not including ranges and not dealing with sync discovered root 2021-04-21 11:04:04 -07:00
Connor Peet
1d951484ed testing: bump distro and make document polyfill work again 2021-04-20 17:03:37 -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
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
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