Skip to content

Commit

Permalink
Merge pull request #173031 from microsoft/hediet/revert-173028
Browse files Browse the repository at this point in the history
Revert "Sends test result messages over to extension host. Fixes regression. (#173028)
  • Loading branch information
hediet committed Feb 1, 2023
2 parents ab239b0 + 0ea69e4 commit e02c6ad
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
2 changes: 1 addition & 1 deletion src/vs/workbench/api/browser/mainThreadTesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh

this._register(resultService.onResultsChanged(evt => {
const results = 'completed' in evt ? evt.completed : ('inserted' in evt ? evt.inserted : undefined);
const serialized = results?.toJSONWithMessages();
const serialized = results?.toJSON();
if (serialized) {
this.proxy.$publishTestResults([serialized]);
}
Expand Down
25 changes: 0 additions & 25 deletions src/vs/workbench/contrib/testing/common/testResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ export interface ITestResult {
* in the workspace.
*/
toJSON(): ISerializedTestResults | undefined;

/**
* Serializes the test result, includes messages. Used to send the test states to the extension host.
*/
toJSONWithMessages(): ISerializedTestResults | undefined;
}

export const resultItemParents = function* (results: ITestResult, item: TestResultItem) {
Expand Down Expand Up @@ -506,10 +501,6 @@ export class LiveTestResult implements ITestResult {
return this.completedAt && this.persist ? this.doSerialize.value : undefined;
}

public toJSONWithMessages(): ISerializedTestResults | undefined {
return this.completedAt && this.persist ? this.doSerializeWithMessages.value : undefined;
}

/**
* Updates all tests in the collection to the given state.
*/
Expand Down Expand Up @@ -594,15 +585,6 @@ export class LiveTestResult implements ITestResult {
request: this.request,
items: [...this.testById.values()].map(TestResultItem.serializeWithoutMessages),
}));

private readonly doSerializeWithMessages = new Lazy((): ISerializedTestResults => ({
id: this.id,
completedAt: this.completedAt!,
tasks: this.tasks.map(t => ({ id: t.id, name: t.name })),
name: this.name,
request: this.request,
items: [...this.testById.values()].map(TestResultItem.serialize),
}));
}

/**
Expand Down Expand Up @@ -700,11 +682,4 @@ export class HydratedTestResult implements ITestResult {
public toJSON(): ISerializedTestResults | undefined {
return this.persist ? this.serialized : undefined;
}

/**
* @inheritdoc
*/
public toJSONWithMessages(): ISerializedTestResults | undefined {
return this.toJSON();
}
}

0 comments on commit e02c6ad

Please sign in to comment.