mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-01-21 22:48:13 +00:00
ed2976b237
This will be temporary* as we hunt down the cause of the random test failures * gonna regret this
25 lines
472 B
Elixir
25 lines
472 B
Elixir
defmodule Mix.Tasks.Pleroma.TestRunner do
|
|
@shortdoc "Retries tests once if they fail"
|
|
|
|
use Mix.Task
|
|
|
|
def run(args \\ []) do
|
|
case System.cmd("mix", ["test"] ++ args, into: IO.stream(:stdio, :line)) do
|
|
{_, 0} ->
|
|
:ok
|
|
|
|
_ ->
|
|
retry(args)
|
|
end
|
|
end
|
|
|
|
def retry(args) do
|
|
case System.cmd("mix", ["test", "--failed"] ++ args, into: IO.stream(:stdio, :line)) do
|
|
{_, 0} ->
|
|
:ok
|
|
|
|
_ ->
|
|
exit(1)
|
|
end
|
|
end
|
|
end
|