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
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

View File

@@ -346,6 +346,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
checkProposedApiEnabled(extension);
return extHostTesting.createTestController(provider, label);
},
createTestItem(id, label, uri) {
checkProposedApiEnabled(extension);
return extHostTesting.createTestItem(id, label, uri);
},
createTestObserver() {
checkProposedApiEnabled(extension);
return extHostTesting.createTestObserver();