@@ -140,8 +140,9 @@ defmodule Mix.Tasks.ReleaseTest do
140140 static_config: { :ok , :was_set } ,
141141 runtime_config: :error ,
142142 sys_config_env: sys_config_env ,
143- sys_config_init: sys_config_init
144- } = wait_until_evaled ( Path . join ( root , "RELEASE_BOOTED" ) )
143+ sys_config_init: sys_config_init ,
144+ encoding: { :"£" , "£" , '£' }
145+ } = wait_until_decoded ( Path . join ( root , "RELEASE_BOOTED" ) )
145146
146147 if match? ( { :win32 , _ } , :os . type ( ) ) do
147148 # `RELEAS~1` is the DOS path name (8 character) for the `release_test` directory
@@ -169,6 +170,7 @@ defmodule Mix.Tasks.ReleaseTest do
169170 File . write! ( "config/releases.exs" , """
170171 import Config
171172 config :release_test, :runtime, :was_set
173+ config :release_test, :encoding, {:runtime, :"£", "£", '£'}
172174 """ )
173175
174176 root = Path . absname ( "_build/dev/rel/runtime_config" )
@@ -198,8 +200,9 @@ defmodule Mix.Tasks.ReleaseTest do
198200 static_config: { :ok , :was_set } ,
199201 runtime_config: { :ok , :was_set } ,
200202 sys_config_env: sys_config_env ,
201- sys_config_init: sys_config_init
202- } = wait_until_evaled ( Path . join ( root , "RELEASE_BOOTED" ) )
203+ sys_config_init: sys_config_init ,
204+ encoding: { :runtime , :"£" , "£" , '£' }
205+ } = wait_until_decoded ( Path . join ( root , "RELEASE_BOOTED" ) )
203206
204207 if match? ( { :win32 , _ } , :os . type ( ) ) do
205208 assert sys_config_env =~ "tmp\\ runtime_config-0.1.0"
@@ -250,7 +253,7 @@ defmodule Mix.Tasks.ReleaseTest do
250253 root_dir: root_dir ,
251254 static_config: { :ok , :was_set } ,
252255 runtime_config: :error
253- } = wait_until_evaled ( Path . join ( root , "RELEASE_BOOTED" ) )
256+ } = wait_until_decoded ( Path . join ( root , "RELEASE_BOOTED" ) )
254257
255258 if match? ( { :win32 , _ } , :os . type ( ) ) do
256259 assert String . ends_with? ( app_dir , "demo/lib/release_test-0.1.0" )
@@ -276,7 +279,7 @@ defmodule Mix.Tasks.ReleaseTest do
276279 script = Path . join ( root , "bin/permanent1" )
277280
278281 open_port ( script , [ 'start' ] )
279- wait_until_evaled ( Path . join ( root , "RELEASE_BOOTED" ) )
282+ wait_until_decoded ( Path . join ( root , "RELEASE_BOOTED" ) )
280283 assert System . cmd ( script , [ "rpc" , "ReleaseTest.hello_world" ] ) == { "hello world\n " , 0 }
281284 assert System . cmd ( script , [ "stop" ] ) == { "" , 0 }
282285
@@ -325,7 +328,7 @@ defmodule Mix.Tasks.ReleaseTest do
325328 release_vsn: "0.1.0" ,
326329 static_config: { :ok , :was_set } ,
327330 runtime_config: { :ok , :was_set }
328- } = wait_until_evaled ( Path . join ( root , "RELEASE_BOOTED" ) )
331+ } = wait_until_decoded ( Path . join ( root , "RELEASE_BOOTED" ) )
329332 end )
330333 end )
331334 end
@@ -342,22 +345,27 @@ defmodule Mix.Tasks.ReleaseTest do
342345 script = Path . join ( root , "bin/permanent2" )
343346 open_port ( script , [ 'daemon_iex' ] )
344347
345- assert wait_until_evaled ( Path . join ( root , "RELEASE_BOOTED" ) ) == % {
346- app_dir: Path . join ( root , "lib/release_test-0.1.0" ) ,
348+ assert % {
349+ app_dir: app_dir ,
347350 cookie_env: "abcdefghij" ,
348351 mode: :embedded ,
349- node: : "permanent2@ #{ @ hostname } " ,
352+ node: release_node ( "permanent2" ) ,
350353 protocols_consolidated?: true ,
351354 release_name: "permanent2" ,
352355 release_node: "permanent2" ,
353- release_root: root ,
356+ release_root: ^ root ,
354357 release_vsn: "0.1.0" ,
355- root_dir: :code . root_dir ( ) |> to_string ( ) ,
358+ root_dir: root_dir ,
356359 static_config: { :ok , :was_set } ,
357360 runtime_config: :error ,
358- sys_config_env: Path . join ( root , "releases/0.1.0/sys" ) ,
359- sys_config_init: Path . join ( root , "releases/0.1.0/sys" )
360- }
361+ sys_config_env: sys_config_env ,
362+ sys_config_init: sys_config_init
363+ } = wait_until_decoded ( Path . join ( root , "RELEASE_BOOTED" ) )
364+
365+ assert app_dir == Path . join ( root , "lib/release_test-0.1.0" )
366+ assert root_dir == :code . root_dir ( ) |> to_string ( )
367+ assert sys_config_env == Path . join ( root , "releases/0.1.0/sys" )
368+ assert sys_config_init == Path . join ( root , "releases/0.1.0/sys" )
361369
362370 assert wait_until ( fn ->
363371 File . read! ( Path . join ( root , "tmp/log/erlang.log.1" ) ) =~
@@ -403,8 +411,8 @@ defmodule Mix.Tasks.ReleaseTest do
403411 Port . open ( { :spawn_executable , to_charlist ( command ) } , [ :hide , args: args ] )
404412 end
405413
406- defp wait_until_evaled ( file ) do
407- wait_until ( fn -> File . exists? ( file ) && Code . eval_file ( file ) |> elem ( 0 ) end )
414+ defp wait_until_decoded ( file ) do
415+ wait_until ( fn -> File . exists? ( file ) && file |> File . read! ( ) |> :erlang . binary_to_term ( ) end )
408416 end
409417
410418 defp wait_until ( fun ) do
0 commit comments