Is anyone else seeing this behaviour? I wonder if it’s desired behaviour or a bug…
I have an umbrella
app2/ # phoenix app, depending on phoenix_html and app1
When I cd into /app/app1 and
mix test, I get
** (Mix) Could not start application phoenix_html: could not find application file: phoenix_html.app
I cd to /app/app2, run
mix test there to ensure phoenix_html is present. Then I cd back, but the problem still exists…
Each umbrella app must declare it’s own dependencies properly. Only if you start things from the root folder all apps and their respective dependencies are started. If you run
mix test only for one app, only this apps dependencies are started. So if
aap1 depends on
phoenix_html, then you should decplade that in it’s mix.exs.
Did you generate your codebase with
app1 should not have dependencies on
phoenix_html since it should only contain contexts and persistence (ie Ecto) logic.
Do you happen to have a misplaced test module using html function?
It uses the build and deps path from the root, which I think is standard:
def project do
elixir: "~> 1.8",
elixirc_options: [warnings_as_errors: true],
start_permanent: Mix.env == :prod,
test_coverage: [tool: Coverex.Task],
Also I’m pretty sure this worked on Elixir 1.7.4, and probably broke when I recently upgraded to 1.8.1
Your tests are running from the umbrella/root directory?
The problem exists when I run tests from /apps/app1.
And instead of
mix test I can run
MIX_ENV=test iex -S mix to get the error.
What are your deps for app1?
I had a similar problem, it was fixed in Elixir 1.8.1
Thank you, upgrading seems to fix the problem.