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
Ability to pass different args and use different environments for different tasks #80
Comments
Hello, I concur this - I run credo before my tests and I would love to specify some arguments to it while use --stale with tests as well. |
Hi, I'm running in to the same issue when use with credo, and keep getting error.
be able to specify which task would be awesome! |
This seems to work for me: # config/config.exs
use Mix.Config
if Mix.env == :dev do
config :mix_test_watch,
tasks: [
"test --stale",
"credo -a --strict",
]
end |
Because `mix test.interactive` is geared towards running `mix test` interactively, some of the configuration options inherited from mix-test.watch don't make as much sense. With interactive mode, changing the CLI executable from `mix` to `iex -S mix` doesn't work, so we now hard-code that to `mix`. If there is another use case for this option, I'm willing to reconsider. The support for running multiple tasks was not ideal, as it would pass the same arguments to all of the commands, which is probably not what we really want (see lpil/mix-test.watch#80) for example. However, there is still a use for defining a task alias that runs `mix test` under the hood, so we still allow configuration of a single task. However, `mix test.interactive` assumes that the custom task accepts the same command-line arguments as `mix test`. Again, if there is a legitimate use cas e for running multiple tasks, I'm willing to consider adding that feature back, but I'd want to find a way to allow different arguments to be passed to different tasks.
The ability to run tasks under separate envs would be really nice. I have e2e tests which run in an |
This would be great and a lot more flexible:
As noted in #56, the dialyzer task fails if passed unknown args. Also, the default env to run the task in is "dev" (I don't know if this matters much though).
The above API seems to make a lot of sense though and would offer a lot of flexibility.
The text was updated successfully, but these errors were encountered: