Closed DanielPenning closed 2 months ago
Normally, when trying to run a suite below the project directory with robot
, you have to be very careful and possibly adjust all paths that need to be passed (outputdir, python_path), the ${EXECDIR}
and some other internal variables change, the IDs of the tests change, etc.
RobotCode (in VSCode and on the console) tries to avoid/improve this by trying to find a project directory from which it should start "robot". RobotCode searches for it from the current directory upwards for various properties that indicate a project directory. If it doesn't find one, it takes the current directory.
The indications of a project directory are:
robot.toml
, .robot.toml
filespyproject.toml
.git
or .hg
directorySo if you want to open a subdirectory of a Git repository in VSCode and this should be your Execdir, you currently still have to create a robot.toml
file. In the future, there will be a way to turn off the detection, or to explicitly specify the ${Execdir}
, I still have to see how I do that.
That's why I leave this question/issue open and convert it into an enhancement.
Thanks for the detailed explanation. 👍
RobotFramework defines
${EXECDIR}
asI 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:
explore.robot
:project_dir
in VS Code and runexplore.robot
, the output is the absolute path to project_dir. As expected.subfolder
in VS Code and runexplore.robot
, the output is the still the absolute path to project_dir.subfolder
in VS Code and runexplore.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