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:

- https://github.com/microsoft/vscode-extension-samples/commit/3fad3d66c110107946f827daedd7759cad7c4358
- https://github.com/microsoft/vscode-selfhost-test-provider/commit/3aff74631605dfd4120b98014f54ff744f292fe0
This commit is contained in:
Connor Peet
2021-07-14 18:08:04 -07:00
parent 039582c0dd
commit 581ff12c39
18 changed files with 662 additions and 367 deletions
+1
View File
@@ -198,6 +198,7 @@
"type": "pwa-chrome",
"request": "launch",
"name": "Launch VS Code Internal",
"trace": true,
"windows": {
"runtimeExecutable": "${workspaceFolder}/scripts/code.bat"
},