Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/1 Enhancements/4727.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update status of test suite when all tests pass (parametric tests)
14 changes: 14 additions & 0 deletions src/client/unittests/common/services/testResultsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ export class TestResultsService implements ITestResultsService {
}
}
});
tests.testSuites.forEach(item => {
if (typeof item.testSuite.passed === 'boolean') {
if (status === TestStatus.Pass ? item.testSuite.passed : !item.testSuite.passed) {
visitParentsRecursive(tests, item.testSuite, visitor);
}
}
});
tests.testFunctions.forEach(item => {
if (typeof item.testFunction.passed === 'boolean') {
if (status === TestStatus.Pass ? item.testFunction.passed : !item.testFunction.passed) {
visitParentsRecursive(tests, item.testFunction, visitor);
}
}
});
}
private updateTestFolderResults(testFolder: TestFolder): void {
let totalTime = 0;
Expand Down
3 changes: 3 additions & 0 deletions src/client/unittests/explorer/testTreeViewItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export class TestTreeItem extends TreeItem {
return '';
}
if (this.testType !== TestType.testFunction) {
if (result.functionsPassed === undefined) {
return '';
}
return `${result.functionsFailed} failed, ${result.functionsPassed} passed in ${+result.time.toFixed(3)} seconds`;
}
switch (this.data.status) {
Expand Down
4 changes: 4 additions & 0 deletions src/client/unittests/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ export type TestDataItem = TestWorkspaceFolder | TestFolder | TestFile | TestSui

export class TestWorkspaceFolder {
public status?: TestStatus;
public time?: number;
public functionsPassed?: number;
public functionsFailed?: number;
public functionsDidNotRun?: number;
constructor(public readonly workspaceFolder: WorkspaceFolder) { }
public get resource(): Uri {
return this.workspaceFolder.uri;
Expand Down