You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many container-era applications follow the 12-factor-app specification which puts focus on environment variables. The environment variable substitutions used in the configuration files can not be easily tested, which is a problem when the configuration is complex and when one wants to run multiple parallel tests, each with different variables substituted.
Why is substituting environment variables programmatically difficult: the JVM does not expose any API for altering an environment variable unless you resort to some reflection API hacks. Also, even then, the variable gets substituted globally, which prevents you from running different similar tests in parallel.
There exist libraries that address these issues by letting the user programmatically alter the environment variables in specified scope (ZIO Config, thanks to ZIO TestSystem), but when you integrate them with this library, they fall short, because Lightbend Config only ever uses the JVM's System class directly.
Ideally, Lightbend Config would expose an API that would let one substitute environment variables programmatically, for the time of loading/resolving of configuration. Such an API could then be used directly or through testing libraries that support the notion of env. var. substitutions.
The text was updated successfully, but these errors were encountered:
Many container-era applications follow the 12-factor-app specification which puts focus on environment variables. The environment variable substitutions used in the configuration files can not be easily tested, which is a problem when the configuration is complex and when one wants to run multiple parallel tests, each with different variables substituted.
Why is substituting environment variables programmatically difficult: the JVM does not expose any API for altering an environment variable unless you resort to some reflection API hacks. Also, even then, the variable gets substituted globally, which prevents you from running different similar tests in parallel.
There exist libraries that address these issues by letting the user programmatically alter the environment variables in specified scope (ZIO Config, thanks to ZIO TestSystem), but when you integrate them with this library, they fall short, because Lightbend Config only ever uses the JVM's System class directly.
Ideally, Lightbend Config would expose an API that would let one substitute environment variables programmatically, for the time of loading/resolving of configuration. Such an API could then be used directly or through testing libraries that support the notion of env. var. substitutions.
The text was updated successfully, but these errors were encountered: