zio-config
zio-config copied to clipboard
Support TestSystem in Typesafe Config provider
Until #1053 gets completed, the TestSystem is basically ignored in the integration with Typesafe Config.
Even though the external library does not support overriding of the System class method calls, there would be a way around this. Both system properties and the environment variables can be altered globally (the latter using a reflection hack), so the only remaining part is to assure, that all Typesafe Config reads are done sequentially - which should be possible using a JVM-global semaphore.
This would unblock testing of how do the environment variables resolve to the configuration values in complex cases.
Another advantage of the proposal is that it's safer for legacy apps (which use complex HOCON configurations already) since all the undocumented quirks of the 3rd party library would work as before. That would make it less risky to port them to ZIO.