Skip to content

Commit

Permalink
testing: fix case sensitivity in file coverage (#200666)
Browse files Browse the repository at this point in the history
File Explorer does not show the coverage bar
Fixes #200604
  • Loading branch information
connor4312 authored Dec 12, 2023
1 parent aec7664 commit dc3b949
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 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 @@ -136,7 +136,7 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh

const fn = available ? ((token: CancellationToken) => TestCoverage.load(taskId, {
provideFileCoverage: async token => await this.proxy.$provideFileCoverage(runId, taskId, token)
.then(c => c.map(IFileCoverage.deserialize)),
.then(c => c.map(u => IFileCoverage.deserialize(this.uriIdentityService, u))),
resolveFileCoverage: (i, token) => this.proxy.$resolveFileCoverage(runId, taskId, i, token)
.then(d => d.map(CoverageDetails.deserialize)),
}, token)) : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class TestCoverageService extends Disposable implements ITestCoverageServ
this._isOpenKey.set(true);
} catch (e) {
if (!cts.token.isCancellationRequested) {
this.notificationService.error(localize('testCoverageError', 'Failed to load test coverage: {}', String(e)));
this.notificationService.error(localize('testCoverageError', 'Failed to load test coverage: {0}', String(e)));
}
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/testing/common/testTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,12 @@ export namespace IFileCoverage {
uri: original.uri.toJSON(),
});

export const deserialize = (serialized: Serialized): IFileCoverage => ({
export const deserialize = (uriIdentity: ITestUriCanonicalizer, serialized: Serialized): IFileCoverage => ({
statement: serialized.statement,
branch: serialized.branch,
function: serialized.function,
details: serialized.details?.map(CoverageDetails.deserialize),
uri: URI.from(serialized.uri),
uri: uriIdentity.asCanonicalUri(URI.revive(serialized.uri)),
});
}

Expand Down

0 comments on commit dc3b949

Please sign in to comment.