robotcode icon indicating copy to clipboard operation
robotcode copied to clipboard

[ENHANCEMENT] Activate other profiles

Open Leemur89 opened this issue 1 year ago • 2 comments

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:

  • server_UAT
  • server_PREPROD
  • dryrun
  • ci

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

Leemur89 avatar Sep 12 '24 07:09 Leemur89

good idea ;-)

d-biehl avatar Sep 16 '24 19:09 d-biehl

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)

Leemur89 avatar Sep 18 '24 13:09 Leemur89