Skip to content

Commit 25cb404

Browse files
committed
Correct start of root test item if robotcode.robot.paths is used
1 parent d1d6676 commit 25cb404

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to the "robotcode" extension will be documented in this file
77
- Provide better error messages if python and robot environment not matches RobotCode requirements
88
- fixes [#40](https://github.com/d-biehl/robotcode/issues/40)
99
- Correct restart of language server client if python interpreter changed
10+
- Correct start of root test item if `robotcode.robot.paths` is used
1011

1112
## 0.11.0
1213

vscode-client/testcontrollermanager.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,12 +670,24 @@ export class TestControllerManager {
670670
await DebugManager.runTests(workspace, [], [], [], runId, options, dryRun);
671671
} else {
672672
const includedInWs = testItems
673-
.map((i) => this.findRobotItem(i)?.longname)
673+
.map((i) => {
674+
const ritem = this.findRobotItem(i);
675+
if (ritem?.type == "workspace" && ritem.children?.length) {
676+
return ritem.children[0].longname;
677+
}
678+
return ritem?.longname;
679+
})
674680
.filter((i) => i !== undefined) as string[];
675681
const excludedInWs =
676682
(excluded
677683
.get(workspace)
678-
?.map((i) => this.findRobotItem(i)?.longname)
684+
?.map((i) => {
685+
const ritem = this.findRobotItem(i);
686+
if (ritem?.type == "workspace" && ritem.children?.length) {
687+
return ritem.children[0].longname;
688+
}
689+
return ritem?.longname;
690+
})
679691
.filter((i) => i !== undefined) as string[]) ?? [];
680692

681693
const suites = new Set<string>();
@@ -687,7 +699,11 @@ export class TestControllerManager {
687699
if (longname) suites.add(longname);
688700
}
689701
} else {
690-
const longname = this.findRobotItem(testItem)?.longname;
702+
const ritem = this.findRobotItem(testItem);
703+
let longname = ritem?.longname;
704+
if (ritem?.type == "workspace" && ritem.children?.length) {
705+
longname = ritem.children[0].longname;
706+
}
691707
if (longname) suites.add(longname);
692708
}
693709
}

0 commit comments

Comments
 (0)