Skip to content

[BUG] PyCharm gutter play runner uses root robot.toml but ignores nested project robot.toml in monorepo #584

@lewis-munene

Description

@lewis-munene

Describe the bug
In a monorepo with a root robot.toml and additional robot.toml files inside project folders, the PyCharm gutter play runner appears to load variables from the root robot.toml only and does not apply variables from the nested project-level robot.toml.

However, when I run RobotCode manually from the command line and target the project test path, the nested project robot.toml is discovered and the variables are available.

So the behavior appears inconsistent between PyCharm gutter play runner and the command line

Steps To Reproduce
Here's the monorepo structure:

project-root/
├── .env.test-env
├── libs/
├── projects/
│   ├── api/
│   │   ├── results/
│   │   ├── tests/
│   │   │   └── login_test.robot
│   │   └── robot.toml
│   └── web/
│       ├── results/
│       ├── tests/
│       │   └── example.robot
│       └── robot.toml
└── robot.toml

And here is the root robot.toml:

python-path = ["libs/common"]
log-level = "INFO"
output-dir = "results"
default-profiles = "default"

And the toml at projects/api/robot.toml:

python-path = ["../../libs/common"]
paths = ["tests"]
output-dir = "results"
default-profiles = "default"

[variables]
BASE_URL = "https://local.myapp.com"
API_TIMEOUT = "30s"

[profiles.default]
extend-variables = { BASE_URL = "https://local.myapp.com", API_TIMEOUT = "10s" }

[profiles.staging]
variables = { BASE_URL = "https://staging.myapp.com", API_TIMEOUT = "20s" }

[profiles.prod]
variables = { BASE_URL = "https://prod.myapp.com", API_TIMEOUT = "20s" }

And the robot test at projects/api/tests/login_test.robot:

*** Settings ***
Documentation    Example API test suite
Library          RequestsLibrary
Resource         ../../../libs/common/keywords/common.resource

*** Test Cases ***
Health Check Returns 200
    [Documentation]    Verify the API health endpoint is up
    Create Session    api    ${BASE_URL}
    ${response}=      GET On Session    api    /health
    Should Be Equal As Integers    ${response.status_code}    200

When you open login_test.robot on the IDE and run the test using the Play button:

Expected behavior
The gutter play runner should apply the projects/api/robot.toml configuration, so ${BASE_URL} should be available from the nested project config.

Actual behaviour
The gutter play runner appears to use the root robot.toml only. ${BASE_URL} is not found, and the test fails with this error:

Variable '${BASE_URL}' not found.

Additional context
If I run RobotCode manually from the command line and target the project path, the nested projects/api/robot.toml is discovered and the variable is available.

Desktop (please complete the following information):

  • IDE: PyCharm
  • OS: Windows
  • RobotCode version: 2.3.1
  • Robot Framework version: 7.4.2
  • Python version: 3.14.3

UPDATE: Same thing happens on VSCode

Metadata

Metadata

Assignees

No one assigned

    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