testing: remove redundant parent in InternalTestItem (#162621)

Initially, test IDs were just the strings given by the extension, but
a while ago we changed to the "extId", which is a concatenation of the
ID the extension provided, with all the parent IDs and the test
controller ID, so that we can uniquely identify any given test.

```
someController\0parent1\0parent2\0my test case
```

Because of this, we can derive the parent extId from any test's extId,
but we never got rid of this duplicate information. In this PR,
we do.
This commit is contained in:
Connor Peet
2022-10-03 21:21:05 -07:00
committed by GitHub
parent beefa47111
commit 90e165a528
15 changed files with 98 additions and 76 deletions

View File

@@ -102,19 +102,19 @@ suite('ExtHost Testing', () => {
assert.deepStrictEqual(single.collectDiff(), [
{
op: TestDiffOpType.Add,
item: { controllerId: 'ctrlId', parent: null, expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(single.root) } }
item: { controllerId: 'ctrlId', expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(single.root) } }
},
{
op: TestDiffOpType.Add,
item: { controllerId: 'ctrlId', parent: single.root.id, expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(a) } }
item: { controllerId: 'ctrlId', expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(a) } }
},
{
op: TestDiffOpType.Add,
item: { controllerId: 'ctrlId', parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-aa') as TestItemImpl) }
item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-aa') as TestItemImpl) }
},
{
op: TestDiffOpType.Add,
item: { controllerId: 'ctrlId', parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-ab') as TestItemImpl) }
item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-ab') as TestItemImpl) }
},
{
op: TestDiffOpType.Update,
@@ -122,7 +122,7 @@ suite('ExtHost Testing', () => {
},
{
op: TestDiffOpType.Add,
item: { controllerId: 'ctrlId', parent: single.root.id, expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) }
item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) }
},
{
op: TestDiffOpType.Update,
@@ -184,7 +184,6 @@ suite('ExtHost Testing', () => {
{
op: TestDiffOpType.Add, item: {
controllerId: 'ctrlId',
parent: new TestId(['ctrlId', 'id-a']).toString(),
expand: TestItemExpandState.NotExpandable,
item: convert.TestItem.from(child),
}
@@ -213,7 +212,6 @@ suite('ExtHost Testing', () => {
{
op: TestDiffOpType.Add, item: {
controllerId: 'ctrlId',
parent: new TestId(['ctrlId', 'id-a']).toString(),
expand: TestItemExpandState.NotExpandable,
item: convert.TestItem.from(child),
}
@@ -326,7 +324,7 @@ suite('ExtHost Testing', () => {
},
{
op: TestDiffOpType.Add,
item: { controllerId: 'ctrlId', parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) }
item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) }
},
]);