Skip to content

[BUG] Variable imports with the same file name, not the same directory, are not handled correctly #214

@johannesh

Description

@johannesh

Describe the bug
Variables from variable files are displayed as not found if another variable file with the same name is imported. Tests run successfully, though, which makes debugging kind of tricky.

To Reproduce
Steps to reproduce the behavior:

  1. Create two folders test_a and test_b
  2. Create a variables.yaml file with a least one variable in each folder and one in the root folder
  3. Create a robot file importing the yaml files and using that variables
  4. See error "Variable not found" - robotcode.namespace(VariableNotFound)
  5. Run the test and see all variables being logged correctly

If possible add some example source code like:

*** Settings ***
Documentation       This file outputs the variables import from variable files from
...                 different folders with the same name

Variables           variables.yaml
Variables           folder_a${/}variables.yaml
Variables           folder_b${/}variables.yaml



*** Test Cases ***
Test Case 1
    [Documentation]    This test case uses the variables from the variables.yaml file
    [Tags]    variables
    Log    ${VAR_A}
    Log    ${VAR_B}
    Log    ${VAR_C}

variable_test.zip

Expected behavior
The variables of .yaml files should always be displayed.

Screenshots/ Videos
Screenshot of issue
image

Desktop:

  • VS Code Version 1.860
  • RobotCode Version 0.73.3
  • OS: Windows 10
  • Python Version: 3.11.3
  • RobotFramework Version: 7.0
  • We also have robocop, robotidy, black, mypy and ruff installed

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions