Skip to content

[ENHANCEMENT] Definition and handling of ${EXECDIR} #201

@DanielPenning

Description

@DanielPenning

RobotFramework defines ${EXECDIR} as

An absolute path to the directory where test execution was started from.

I am surprised by how this variable is handled in Visual Studio Code. This affects both the execution and also the test explorer.

Consider this directory structure:

project_dir
- .git
- subfolder
     - explore.robot

explore.robot:

*** Test Cases ***
Print ExecDir
    Log To Console    ${EXECDIR}
  • When I open project_dir in VS Code and run explore.robot, the output is the absolute path to project_dir. As expected.
  • When I open subfolder in VS Code and run explore.robot, the output is the still the absolute path to project_dir.
  • When I init a git repo inside subfolder, open subfolder in VS Code and run explore.robot, the output is the absolute path to subfolder.

One can observe the same behaviour in the test explorer. Somehow the git repo of an upper folder - even when not part of the folder currently opened in VS Code- seems to be taken into account for root path determination.

This is very counterintuitive for me. I would expect that EXECDIR is basically equal to ${workspaceDir} VS Code variable.

Desktop

  • VS Code Version: 1.85.2
  • RobotCode Version 0.69
  • OS: Windows
  • Python Version: 3.10.6
  • RobotFramework Version: 6.1

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions