Skip to content

Commit 27af79c

Browse files
authored
Add log directory to eunit setup template (#4493)
To log messages of test-runs to a single file, we need to add a absoulute path to the file logger.
1 parent 09dca4e commit 27af79c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

rel/files/eunit.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ port = 0
3030
[log]
3131
; log to a file to save our terminals from log spam
3232
writer = file
33-
file = couch.log
33+
file = {{log_dir}}/couch.log
3434
level = info
3535

3636
[replicator]
3737
; disable jitter to reduce test run times
38-
startup_jitter = 0
38+
startup_jitter = 0

rel/plugins/eunit_plugin.erl

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ build_eunit_config(Config0, AppFile) ->
3131
ViewIndexDir = Cwd ++ "/tmp/data",
3232
StateDir = Cwd ++ "/tmp/data",
3333
TmpDataDir = Cwd ++ "/tmp/tmp_data",
34+
LogDir = Cwd ++ "/tmp",
3435
cleanup_dirs([DataDir, TmpDataDir]),
3536
Config1 = rebar_config:set_global(Config0, template, "setup_eunit"),
3637
Config2 = rebar_config:set_global(Config1, prefix, Cwd),
3738
Config3 = rebar_config:set_global(Config2, data_dir, DataDir),
3839
Config4 = rebar_config:set_global(Config3, view_index_dir, ViewIndexDir),
39-
Config = rebar_config:set_global(Config4, state_dir, StateDir),
40+
Config5 = rebar_config:set_global(Config4, log_dir, LogDir),
41+
Config = rebar_config:set_global(Config5, state_dir, StateDir),
4042
rebar_templater:create(Config, AppFile).
4143

4244
cleanup_dirs(Dirs) ->

setup_eunit.template

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
{data_dir, "/tmp"},
99
{prefix, "/tmp"},
1010
{view_index_dir, "/tmp"},
11-
{state_dir, "/tmp"}
11+
{state_dir, "/tmp"},
12+
{log_dir, "/tmp"}
1213
]}.
1314
{dir, "tmp"}.
1415
{dir, "tmp/etc"}.

0 commit comments

Comments
 (0)