-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mix - Alias to run multiple tasks from different environments #7162
Comments
Can you please provide a minimal mix.exs that reproduces the error?
We cant run multiple environments in the same Mix command because apps may
have already been booted with different settings. You can add dialyzer to
the test environment though.
--
*José Valimwww.plataformatec.com.br
<http://www.plataformatec.com.br/>Founder and Director of R&D*
|
Sure https://github.com/dylan-chong/elixir_environment_error_test I put 2 different tasks there with different orderings of the tasks - check1, check2
Good idea! |
I am getting the proper error in both tasks:
Please let us know if there is anything else to reproduce this issue. Thank you! |
@dylan-chong Hi.
defp deps do
[
{:credo, "~> 0.8", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 0.5", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.7", only: [:dev, :test], runtime: false},
]
end
defp aliases do
[
"credo": ["credo --strict"],
"coveralls": ["coveralls --umbrella"],
"coveralls.detail": ["coveralls.detail --umbrella"],
"full_check": ["credo", "dialyzer", "test --listen-on-stdin --stale"],
"check": ["credo", "test --listen-on-stdin --stale"],
]
end
defp dialyzer do
[
flags: [:error_handling, :race_conditions, :underspecs, :unmatched_returns],
plt_add_apps: [:ex_unit, :mix],
]
end Remember about add |
@josevalim Strange, the error messages a showing today for me as well. Not sure what changed since yesterday. I'll reopen this issue if there is a more reliable way to replicate the issue @bartoszgorka Yes adding dialyser to the test environment works for me |
Precheck
Environment
Current behavior
In my
mix.exs
:Running
mix check
from the command line yields** (Mix) "mix test" is running on environment "dev". If you are running tests along another task, please set MIX_ENV explicitly
(this error is silently suppressed if"test"
is the last task in the list, so you have to move to the top of the list to see this error).However, running
MIX_ENV=test mix check
yields** (Mix) The task "dialyzer" could not be found
. Presumably thedialyzer
task is not in the test environment, only dev.Expected behavior
Firstly, the error above should not be silently suppressed if the task is the last on the list.
There should be some way to run multiple tasks from multiple environments together. Or maybe not? The alternative could just be to write a bash script?
The text was updated successfully, but these errors were encountered: