I’m trying to override some configurations prior to running integration tests in my umbrella app. I’m using mocks for my unit tests, but want to use my “live” modules for integration tests. The default configurations are stored in the dev.exs
and test.exs
config files. Before running the integration test I use Application.put_env/4
to set the “live” configuration (including the :persistent
option), but when I inspect the configuration during the test, it shows the mocks are being used (the integration tests are failing).
Is this a run vs. compile time thing? I’ve had to run mix compile
in the past to get changes to my config files to persist when I start my application.
Here’s a timely article on this very thing, but I can’t set the module explicitly in the test they way they do in the article, I need to rely on the configuration.