stoplightio / desktop

The Stoplight desktop app + issues repository.
https://stoplight.io
78 stars 13 forks source link

Problem with $$.env variables in utilities #347

Closed ntiss closed 5 years ago

ntiss commented 6 years ago

$$.env variables that are populated inside utilities, within a script $$.env.set(), are not shared (or returned) with the caller scenario. When a utilities scenario is called by reference, the $$.env vars stay empty in the main scenario even if they are well fed in the script step (visible in the ca.pture tab). However, it works fine with $.ctx variables.

Please find in attachment a simple scenario to reproduce and analyse : the $$.env.envRandomIdFromUtil is lost when running the third step of the main scenario. In the same time $.ctx.ctxRandomIdFromUtil is well propagated

bug_envVarsInUtilities.scenarios.json.txt

tbarn commented 6 years ago

@ntiss thanks for reporting this! I will take a look into it. How much of a blocker is this for you? I can get it added to the current sprint, but it will be a couple of weeks before the fix would be released.

ntiss commented 6 years ago

Hi @tbarn This is not blocking at all for us since we can work through $.ctx vars. I opened this issue because it's really weird and inconsistent between $.ctx and $$.env.

lottamus commented 5 years ago

This issue has been fixed in v4.7.0. Thanks for reporting!