Skip to content

Commit c48f220

Browse files
committed
Correct reolving paths for test execution
1 parent 3acd15f commit c48f220

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

robotcode/language_server/robotframework/parts/discovering.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class FindTestCasesVisitor(AsyncVisitor):
6262
async def get(self, source: DocumentUri, model: ast.AST, base_name: Optional[str]) -> List[TestItem]:
6363
self._results: List[TestItem] = []
6464
self.source = source
65-
self.path = Uri(source).to_path()
65+
self.path = Uri(source).to_path().resolve()
6666
self.base_name = base_name
6767
await self.visit(model)
6868
return self._results
@@ -265,7 +265,8 @@ def generate(suite: TestSuite) -> TestItem:
265265
children.append(
266266
TestItem(
267267
type="test",
268-
id=f"{test.source if test.source is not None else ''};" f"{test.longname};{test.lineno}",
268+
id=f"{Path(test.source).resolve() if test.source is not None else ''};"
269+
f"{test.longname};{test.lineno}",
269270
label=test.name,
270271
longname=test.longname,
271272
uri=str(Uri.from_path(test.source)) if test.source else None,
@@ -282,7 +283,7 @@ def generate(suite: TestSuite) -> TestItem:
282283

283284
return TestItem(
284285
type="suite",
285-
id=f"{suite.source if suite.source is not None else ''};{suite.longname}",
286+
id=f"{Path(suite.source).resolve() if suite.source is not None else ''};{suite.longname}",
286287
label=suite.name,
287288
longname=suite.longname,
288289
uri=str(Uri.from_path(suite.source)) if suite.source else None,
@@ -348,7 +349,7 @@ def nonexisting_paths(paths: List[str]) -> Iterator[str]:
348349
return [
349350
TestItem(
350351
type="workspace",
351-
id=str(Path.cwd()),
352+
id=str(Path.cwd().resolve()),
352353
label=Path.cwd().name,
353354
longname=Path.cwd().name,
354355
uri=str(Uri.from_path(Path.cwd())),
@@ -381,7 +382,7 @@ def nonexisting_paths(paths: List[str]) -> Iterator[str]:
381382
return [
382383
TestItem(
383384
type="error",
384-
id=str(Uri.from_path(Path.cwd())),
385+
id=str(Uri.from_path(Path.cwd().resolve())),
385386
longname="error",
386387
label=Path.cwd().name,
387388
error=str(e),

0 commit comments

Comments
 (0)