@@ -61,7 +61,7 @@ defmodule Mix.Tasks.DepsTest do
6161 end
6262 end
6363
64- defmodule RawRepoDep do
64+ defmodule RawRepoDepApp do
6565 def project do
6666 [
6767 app: :raw_sample ,
@@ -219,6 +219,38 @@ defmodule Mix.Tasks.DepsTest do
219219 end )
220220 end
221221
222+ test "compiles deps using os partitions" do
223+ System . put_env ( "MIX_OS_DEPS_COMPILE_PARTITION_COUNT" , "2" )
224+
225+ in_fixture ( "deps_status" , fn ->
226+ File . write! ( "mix.exs" , """
227+ defmodule ParDepsApp do
228+ use Mix.Project
229+
230+ def project do
231+ [
232+ app: :par_sample,
233+ version: "0.1.0",
234+ deps: [
235+ {:raw_repo, "0.1.0", path: "custom/raw_repo"},
236+ {:git_repo, "0.1.0", path: #{ inspect ( fixture_path ( "git_repo" ) ) } }
237+ ]
238+ ]
239+ end
240+ end
241+ """ )
242+
243+ Mix.Project . in_project ( :par_sample , "." , fn _ ->
244+ output = ExUnit.CaptureIO . capture_io ( fn -> Mix.Tasks.Deps.Compile . run ( [ ] ) end )
245+ assert output =~ ~r/ \d > Generated git_repo app/
246+ assert output =~ ~r/ \d > Generated raw_repo app/
247+ assert_received { :mix_shell , :info , [ "mix deps.compile running across 2 OS processes" ] }
248+ end )
249+ end )
250+ after
251+ System . delete_env ( "MIX_OS_DEPS_COMPILE_PARTITION_COUNT" )
252+ end
253+
222254 test "doesn't compile any umbrella apps if --skip-umbrella-children is given" do
223255 in_fixture ( "umbrella_dep/deps/umbrella" , fn ->
224256 Mix.Project . in_project ( :umbrella , "." , fn _ ->
@@ -414,7 +446,7 @@ defmodule Mix.Tasks.DepsTest do
414446
415447 test "sets deps env to prod by default" do
416448 in_fixture ( "deps_status" , fn ->
417- Mix.Project . push ( RawRepoDep )
449+ Mix.Project . push ( RawRepoDepApp )
418450
419451 Mix.Tasks.Deps.Update . run ( [ "--all" ] )
420452 assert_received { :mix_shell , :info , [ ":raw_repo env is prod" ] }
@@ -751,7 +783,7 @@ defmodule Mix.Tasks.DepsTest do
751783
752784 test "checks if compile env changed" do
753785 in_fixture ( "deps_status" , fn ->
754- Mix.Project . push ( RawRepoDep )
786+ Mix.Project . push ( RawRepoDepApp )
755787 Mix.Tasks.Deps.Loadpaths . run ( [ ] )
756788 assert_receive { :mix_shell , :info , [ "Generated raw_repo app" ] }
757789 assert Application . spec ( :raw_repo , :vsn )
@@ -766,7 +798,7 @@ defmodule Mix.Tasks.DepsTest do
766798 Application . unload ( :raw_repo )
767799 Mix.ProjectStack . pop ( )
768800 Mix.Task . clear ( )
769- Mix.Project . push ( RawRepoDep )
801+ Mix.Project . push ( RawRepoDepApp )
770802 purge ( [ RawRepo ] )
771803 Mix.Tasks.Loadconfig . load_compile ( "config/config.exs" )
772804
0 commit comments