robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
183 stars 15 forks source link

[ENHANCEMENT] Activate other profiles #308

Open Leemur89 opened 1 month ago

Leemur89 commented 1 month ago

Hello,

I'd like to be able to activate other profiles when selecting one. Note that this is different from the inherit For instance let say I have the following profiles:

Both server_* profiles are setting some variables required for my tests to run (like URL and stuff) Dryrun is to run tests in dryrun mode, but it still requires some var to avoid undefined variable errors (vars that can be set from above profiles) And ci is enabled if in ci.

I would like something like:

[profiles.dryrun]
activate_profiles = ["server_UAT", "ci"]

Then in my pipeline I would call my job simply with robotcode -p dryrun robot

Why does inherit not work? For instance ci profile is only enabled in ci environment:

[profiles.ci]
enabled = { if = "environ.get('CI') == 'true'" }

With inherit my dryrun profile would also inherit that enable parameter. Here I want that the dryrun profile to be enabled no matter what, but not the ci

Recap

Command robotcode -p dryrun robot Always activate the server_UAT profile If from CI environment, also activate ci profile

Hope it is clear enough

Thanks

d-biehl commented 1 month ago

good idea ;-)

Leemur89 commented 1 month ago

Hi,

I've just found our about the existence of the possibility to select the desired profiles from the env variable ROBOTCODE_PROFILES, which actually perfectly covers my needs for CI (btw it lacks the tiny explanation of the separator, which I know now that is a space, in the documentation)