Moving from an umbrella application to path-based dependencies

Primarily due to testing concerns I am finding that umbrella applications are not working for us. We currently have 8 applications and I am trying to extract a 9nth from one of the existing applications (the largest one). I am running into what feels like a multitude of issues, but by far the largest one is that it is severely restricting to have a single global configuration while testing.

As a specific example, in one ecto-using app (let’s call it SubApp), whenever a new comment is created I want to notify any interested listeners. So when testing that app I use Mox to verify that any listeners (SubApp.Test.MockListener) are indeed notified. But when I am testing a higher-level app that uses the first app, I don’t want to be adding an assertion on SubApp.Test.MockListener and manually stubbing everything to the concrete implementation that I have, instead I want my actual listener to be called directly.

So does anyone have any tips or guides for moving from an umbrella application to multiple path-based applications? I’m wondering/hoping if I can make the move piece-meal as I already have a huge commit trying to extract this new application.

Related thread: Integration testing Phoenix/umbrella app

1 Like

Let’s say you have two apps - ProduceApp and SubscribeApp.

From ProduceApp point of view, it should not know anything about listeners. It just sends event, and to test it you need to configure mock listener to test it.

When you test SubscribeApp, you may not make it dependent to ProduceApp directly. You may have a library package (e.g. EventApp) to share modules and functions between ProduceApp and SubscribeApp though.

Then how can we test SubscribeApp works with ProduceApp? I think it’s more of question that who should own the linkage information. I think it should be another application to bond them together - it depends on both, and configure ProduceApp to listen SubscribeApp.