Skip to content
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

Feature: Loop on failed #101

Open
TheFirstAvenger opened this issue Oct 23, 2018 · 1 comment
Open

Feature: Loop on failed #101

TheFirstAvenger opened this issue Oct 23, 2018 · 1 comment

Comments

@TheFirstAvenger
Copy link
Contributor

A common pattern we use with mix-test.watch is to run mix tes.watcht, and if any errors are found run mix test.watch --failed, fixing errors until all the failed ones are clear, then run mix test.watch again, and if any new errors are found, run mix test.watch --failed, basically swapping between these two states of running a full mix test.watch and running mix test.watch --failed. Pseudocode:

def loop do
  case "mix test" do
    :errors ->
      loop_on_failed()
      loop()
    :no_errors ->
      wait_for_change()
      loop()
  end
end

def loop_on_failed do
  case "mix test --failed" do
    :errors ->
      wait_for_changes()
      loop_on_failed()
    :no_errors ->
      nil
  end
end

Would love to see a flag in mix test.watch that would mimic this. Something like mix test.watch --loop-failed

@jwilger
Copy link

jwilger commented Mar 25, 2020

@TheFirstAvenger : Adding something like this to your mix config would probably get you what you are looking for:

config :mix_test_watch,
  tasks: [
    "test --failed --exclude pending",
    "test --stale --exclude pending",
    "test --exclude pending"
  ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants