@@ -502,7 +502,6 @@ defmodule Mix.Tasks.Test do
502502 @ impl true
503503 def run ( args ) do
504504 { opts , files } = OptionParser . parse! ( args , strict: @ switches , aliases: [ b: :breakpoints ] )
505- opts = put_manifest_file ( opts )
506505
507506 if not Mix.Task . recursing? ( ) do
508507 do_run ( opts , args , files )
@@ -576,6 +575,7 @@ defmodule Mix.Tasks.Test do
576575 Mix.Task . run ( "compile" , args -- [ "--warnings-as-errors" ] )
577576
578577 project = Mix.Project . config ( )
578+
579579 { partitions , opts } = Keyword . pop ( opts , :partitions )
580580 partitioned? = is_integer ( partitions ) and partitions > 1
581581
@@ -667,7 +667,7 @@ defmodule Mix.Tasks.Test do
667667 catch
668668 kind , reason ->
669669 # Also mark the whole suite as failed
670- file = Keyword . fetch! ( opts , :failures_manifest_path )
670+ file = get_manifest_path ( opts )
671671 ExUnit.Filters . fail_all! ( file )
672672 :erlang . raise ( kind , reason , __STACKTRACE__ )
673673 else
@@ -871,7 +871,10 @@ defmodule Mix.Tasks.Test do
871871 defp merge_helper_opts ( opts ) do
872872 # The only options that are additive from app env are the excludes
873873 value = List . wrap ( Application . get_env ( :ex_unit , :exclude , [ ] ) )
874- Keyword . update ( opts , :exclude , value , & Enum . uniq ( & 1 ++ value ) )
874+
875+ opts
876+ |> Keyword . update ( :exclude , value , & Enum . uniq ( & 1 ++ value ) )
877+ |> Keyword . put_new_lazy ( :failures_manifest_path , fn -> get_manifest_path ( [ ] ) end )
875878 end
876879
877880 defp default_opts ( opts ) do
@@ -918,16 +921,14 @@ defmodule Mix.Tasks.Test do
918921
919922 @ manifest_file_name ".mix_test_failures"
920923
921- defp put_manifest_file ( opts ) do
922- Keyword . put_new_lazy (
923- opts ,
924- :failures_manifest_path ,
925- fn -> Path . join ( Mix.Project . manifest_path ( ) , @ manifest_file_name ) end
926- )
924+ defp get_manifest_path ( opts ) do
925+ opts [ :failures_manifest_path ] ||
926+ Application . get_env ( :ex_unit , :failures_manifest_path ) ||
927+ Path . join ( Mix.Project . manifest_path ( ) , @ manifest_file_name )
927928 end
928929
929930 defp manifest_opts ( opts ) do
930- manifest_file = Keyword . fetch! ( opts , :failures_manifest_path )
931+ manifest_file = get_manifest_path ( opts )
931932
932933 if opts [ :failed ] do
933934 if opts [ :stale ] do
0 commit comments