Hi I am wondering how should I run test for my umbrella app.
given in the umbrella app there are -
- apps that want to start supervision tree manually while testing- usually we use
mix test --no-startin the individual app. See about this more here - https://virviil.github.io/2016/10/26/elixir-testing-without-starting-supervision-tree/. ( I am doing this due to, I want to setup and mock network calls and also test that what is sent on network is what I want during supervision loads).
- apps that wants to start supervision tree - usually we use
- Some of my apps has ecto as it dependency - usually we alias `test: [‘ecto.create --quite’, ‘ecto.migrate’, test] in an individual app.
- And one thing more, if two of our apps has ecto and it dependency how can we make sure that an app that has another app (lets’ called it app2, with ecto), the ecto of app2 is also migrated while running the test of the top level app.
– There are some constraint that I am facing -
- When I add alias [“test”: [“ecto.create”, “ecto.migrate”, “test”]] in the root of my umbrella app like what is recommend here https://github.com/elixir-ecto/ecto/issues/1538. This thing when get executed, it try to boot up the supervision trees of other apps also (which I don’t want it to be booted, since I want to use --no-start and I want to boot them manually)
- Currently to make sure that ecto migrations of dependency app is migrated, run ecto.setup(create and migrate db of all apps, This is added as an alias in root umbrella mix.exs,) before I start any test. (But by doing this here, it will force all apps supervision trees (since this ecto.migrate makes supervision tree to be loaded also), which is one thing I dont want because I wants to test some of my apps with --no-start.