improvements of mix test ?

41 views
Skip to first unread message

gasp...@gmail.com

unread,
Oct 25, 2016, 9:00:35 AM10/25/16
to elixir-lang-core
Hi all!

I want to add following changes to mix test / exunit to improve productivity of development.

Allow `ExUnit.configure start: false` have effect in test_helper.exs, so that there will be no need to specify it on command line every time (right now --no-start command line arg is passed to mix app.start, so this call should be just skipped at all)

Add option to ExUnit to stop after first failed test. This is extremely useful when you use --trace and have many tests and single failed test gets hidden in the middle of output. I want it to be last visible output in console, so that I can inspect it without scrolling up. Also when refactoring I usually go and fix tests one by one. Stopping mix test.watch and specifying every time `--only line:111` to run next test is somehow annoying.

Please provide feedback ;-)

Regards,
Gaspar


Michał Muskała

unread,
Oct 25, 2016, 9:06:33 AM10/25/16
to elixir-l...@googlegroups.com
You can achieve the first thing by defining an alias in mix.exs (like below), but I agree a config in ExUnit for this could make it more convenient.

aliases: ["test": "test --no-start"]

The second issue was already discussed, and I assume a PR would still be accepted: https://github.com/elixir-lang/elixir/issues/4586

Michał.
> --
> You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/0feee546-f25d-49ff-8ae3-4a29e4a052df%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

gasp...@gmail.com

unread,
Oct 25, 2016, 9:10:35 AM10/25/16
to elixir-lang-core


On Tuesday, October 25, 2016 at 4:06:33 PM UTC+3, Michał Muskała wrote:
You can achieve the first thing by defining an alias in mix.exs (like below), but I agree a config in ExUnit for this could make it more convenient.

aliases: ["test": "test --no-start"]

Ahh, cool. But still looks like a hack :) And I want this to work with test.watch :) I do not care that much about 'mix test' task by itself :)
 

The second issue was already discussed, and I assume a PR would still be accepted: https://github.com/elixir-lang/elixir/issues/4586


Missed this one. Okay, then just need to submit PR. thanks!
 

gasp...@gmail.com

unread,
Oct 25, 2016, 10:18:03 AM10/25/16
to elixir-lang-core


On Tuesday, October 25, 2016 at 4:10:35 PM UTC+3, gasp...@gmail.com wrote:


On Tuesday, October 25, 2016 at 4:06:33 PM UTC+3, Michał Muskała wrote:
You can achieve the first thing by defining an alias in mix.exs (like below), but I agree a config in ExUnit for this could make it more convenient.

aliases: ["test": "test --no-start"]

Ahh, cool. But still looks like a hack :) And I want this to work with test.watch :) I do not care that much about 'mix test' task by itself :)
 

Basically it is not possible to prevent app start from ExUnit test_helper, because it is run after app is started. but it is possible just to stop it there with
':application.stop :app_name' which may be reasonable workaround

Regards,
Gaspar


 
Reply all
Reply to author
Forward
0 new messages