Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Proposal: Improve ExUnit feedback when running a subset of tests

50 views
Skip to first unread message

Kieran

unread,
Dec 13, 2024, 2:30:32 PM12/13/24
to elixir-lang-core
When testing a single file with ExUnit you can run a subset of tests by appending a :<line number> to your mix test command.

Problem:

Currently this outputs the overall number of tests in the current module, the number of failures, and the number of tests you've excluded. Example: 24 tests, 2 failures, 15 excluded. This means I have to do mental math to figure out how many tests actually passed. This isn't a huge problem, but when I'm focusing on a refactor it gets tedious to always be thinking "24 minus 15 is 9 so I'm actually testing 9 things, 2 of which are failing".

It's a small amount of additional cognitive overhead that adds up over time. I'm currently in the middle of a large-scale refactor so I'm especially aware of it in this moment

Proposal:

Simply update the output of ExUnit to include how many tests were actually ran. I'm not sure what the best wording would be, but a distinction between how many tests exist within the module vs. how many were tested would be valuable information (at least for me)

José Valim

unread,
Dec 13, 2024, 3:14:26 PM12/13/24
to elixir-l...@googlegroups.com
Yes, I think that’s better, I have ran into the same scenario. Please do submit a PR.



--
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 visit https://groups.google.com/d/msgid/elixir-lang-core/6fc62f86-e0f8-415d-90d0-9bf65bbaaba9n%40googlegroups.com.

Kieran

unread,
Dec 13, 2024, 4:40:13 PM12/13/24
to elixir-lang-core
Great! I'll do that next week (:

Any preference on the wording? A few options:
  • Update the test count to only count the tests that were run. My example above would become: 9 tests, 2 failures, 15 excluded
    • This is my preference, but I'm not picky
  • Keep the existing output but add in a new field for the tests that were run. My example above would become: 24 tests, 9 executed, 2 failures, 15 excluded
    • This one feels more redundant
    • I'm open to labelling it something other than "executed" but that's all I can think of at the moment

José Valim

unread,
Dec 13, 2024, 5:26:39 PM12/13/24
to elixir-l...@googlegroups.com
Let’s just remove excluded from the total of tests. No need to add a new entry. :)



Reply all
Reply to author
Forward
0 new messages