I have a Phoenix app that has a background worker (Genserver) which is responsible for reading and writing to the DB. This worker (MyAppWeb.Workers.AccountWorker) runs once a second. It is located in MyAppWeb because it is responsible for broadcasting to the frontend (which is irrelevant for this question but may answer your question as to why it is under MyAppWeb).
I would like to selectively start this worker depending on the tests being run. For example, if the tests are for the account management than I’d like it to run, however if the integration tests are for messaging then no. I also do not want to run this worker for any of the non-web contexts/business-logic tests.
I was thinking of using Mox for swapping out the module per test but I’m wondering if there is a way to do this without Mox and with the least amount of updating all my tests.