Skip to content

Commit

Permalink
Fix default failures_manifest_file (#13548)
Browse files Browse the repository at this point in the history
  • Loading branch information
chubarovNick committed May 10, 2024
1 parent ae35816 commit 9519a72
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/mix/lib/mix/tasks/test.ex
Expand Up @@ -773,8 +773,14 @@ defmodule Mix.Tasks.Test do
@manifest_file_name ".mix_test_failures"

defp manifest_opts(opts) do
manifest_file = Path.join(Mix.Project.manifest_path(), @manifest_file_name)
opts = Keyword.put(opts, :failures_manifest_file, manifest_file)
opts =
Keyword.put_new(
opts,
:failures_manifest_file,
Path.join(Mix.Project.manifest_path(), @manifest_file_name)
)

manifest_file = Keyword.get(opts, :failures_manifest_file)

if opts[:failed] do
if opts[:stale] do
Expand Down
10 changes: 10 additions & 0 deletions lib/mix/test/mix/tasks/test_test.exs
Expand Up @@ -45,6 +45,16 @@ defmodule Mix.Tasks.TestTest do
]
end

test "respect failures_manifest_file option" do
custom_manifest_file = Path.join(Mix.Project.manifest_path(), ".mix_test_failures_custom")

assert ex_unit_opts(failures_manifest_file: custom_manifest_file) == [
autorun: false,
exit_status: 2,
failures_manifest_file: custom_manifest_file
]
end

defp ex_unit_opts(opts) do
{ex_unit_opts, _allowed_files} = Mix.Tasks.Test.process_ex_unit_opts(opts)
ex_unit_opts
Expand Down

0 comments on commit 9519a72

Please sign in to comment.