- $ mix test test/some/particular/file_test.exs:12
$ mix test --repeat
# Mix would repeat the test in file_test.exs that was at line 12.
# It would be great if Mix remembers the actual name of the test and
# doesn't blindly use the line number which may have shifted after editing
# and cause an entirely different test to be executed.
- $ mix test
# 5 tests failed.
$ mix test --failed
# Mix retries the 5 failing tests. 3 out of 5 tests succeed.
$ mix test --repeat
# Mix would simply repeat the 5 tests, no matter their status.
- $ mix test --seed 1234
$ mix test --repeat
# Mix would repeat all the tests but also remember to use the given seed.
# If --seed is never defined then a different seed is used with each --repeat.
- $ mix test apps/my_sub_app/test
$ mix test --repeat
# Mix would repeat the tests for the given umbrella application.
$ mix test --only external
$ mix test --repeat
# Mix would repeat only the tests tagged by "external". - $ mix test --stale
$ mix test --repeat
# Mix would repeat all the tests if this was the first run with --stale. - $ mix test --stale
# Edit code ...
$ mix test --stale
# Mix runs only tests affected by the code changes.
$ mix test --repeat
# Mix would repeat only the tests that had been marked as stale.
- $ mix test ...
$ mix test --repeat
$ mix test --repeat
# Running with --repeat multiple times would naturally repeat the same tests again.
The basic premise is always: tests X, Y, Z have been run, therefore X, Y, Z will be run again with mix test --repeat.That makes the most sense to me. Maybe there are corner cases, like for example, when you run mix test inside an umbrella app and then you run mix test --repeat outside in the umbrella root. It probably should repeat the tests in that initial umbrella app, but what if the other apps have no previously executed tests? Not a difficult thing to figure out but I'm sure it would happen.
Thanks in advance for your time and considering my proposal!