[Proposal] A 'concise' flag for 'mix test'

43 views
Skip to first unread message

sp

unread,
Feb 3, 2022, 7:47:37 AM2/3/22
to elixir-lang-core
Hello!

While working through a project I found that I just wanted a print out of tests that failed and on what line instead of the full description and stack trace. Something like:
test/my_test.exs:5
test/my_test.exs:12
.... etc

I was able to 'grep' something close to this but feel it would be helpful to pass an option to 'mix test' allowing for a concise output.

I've got something close with the Elixir source code, I've changed the CLI formatter behavior when the option is present, but wanted to make sure others would approve before opening a PR.

Please let me know your thoughts!

José Valim

unread,
Feb 3, 2022, 8:59:18 AM2/3/22
to elixir-lang-core
Hi!

ExUnit supports custom formatters, so my suggestion is to implement your own formatter and plug it in, without a need to change Elixir. :)

--
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/1764a0c9-e191-4f5c-916e-99abdd881c47n%40googlegroups.com.

sp

unread,
Feb 3, 2022, 9:06:48 AM2/3/22
to elixir-lang-core
Hi José! Thank you for the reply!

I thought about that, but couldn't see a way to change the formatter based on a custom flag for 'mix test'...?

Ideally, I'd love to be able to run 'mix test --concise' so I can change the formatter on the fly.

José Valim

unread,
Feb 3, 2022, 9:09:09 AM2/3/22
to elixir-lang-core
IIRC "mix test --formatter MyFormatter" should do it.

sp

unread,
Feb 3, 2022, 9:10:44 AM2/3/22
to elixir-lang-core
Ah, that's much simpler!

Thank you for the help!

Reply all
Reply to author
Forward
0 new messages