Skip to content

Commit 31bf921

Browse files
committed
correct adding suites for executing tests
1 parent 9143b6d commit 31bf921

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

vscode-client/testcontrollermanager.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ export class TestControllerManager {
648648
}
649649
});
650650

651-
for (const [workspace, ids] of included) {
651+
for (const [workspace, testItems] of included) {
652652
const runId = TestControllerManager.runId.next().value;
653653
this.testRuns.set(runId, run);
654654

@@ -664,7 +664,9 @@ export class TestControllerManager {
664664
if (includedItems.length === 1 && includedItems[0] === workspaceItem && excluded.size === 0) {
665665
await DebugManager.runTests(workspace, [], [], [], runId, options, dryRun);
666666
} else {
667-
const includedInWs = ids.map((i) => this.findRobotItem(i)?.longname).filter((i) => i !== undefined) as string[];
667+
const includedInWs = testItems
668+
.map((i) => this.findRobotItem(i)?.longname)
669+
.filter((i) => i !== undefined) as string[];
668670
const excludedInWs =
669671
(excluded
670672
.get(workspace)
@@ -673,14 +675,15 @@ export class TestControllerManager {
673675

674676
const suites = new Set<string>();
675677

676-
for (const t of [...includedInWs, ...excludedInWs]) {
677-
const testItem = this.findTestItemById(t);
678+
for (const testItem of [...testItems, ...(excluded.get(workspace) || [])]) {
678679
if (!testItem?.canResolveChildren) {
679680
if (testItem?.parent) {
680-
suites.add(testItem.parent.id);
681+
const longname = this.findRobotItem(testItem?.parent)?.longname;
682+
if (longname) suites.add(longname);
681683
}
682684
} else {
683-
suites.add(t);
685+
const longname = this.findRobotItem(testItem)?.longname;
686+
if (longname) suites.add(longname);
684687
}
685688
}
686689
await DebugManager.runTests(workspace, Array.from(suites), includedInWs, excludedInWs, runId, options, dryRun);

0 commit comments

Comments
 (0)