diff options
author | Ronny Berndt <ronny@apache.org> | 2023-03-23 21:41:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-23 21:41:40 +0100 |
commit | 27af79c4a55b238d7fa768cc86962ccd011c7382 (patch) | |
tree | dbe88fa8d42a4e6c7364b171a37001fbc9a9430d | |
parent | 09dca4e5b3b44f7077d283b0c0dc6d56b8eda0da (diff) | |
download | couchdb-27af79c4a55b238d7fa768cc86962ccd011c7382.tar.gz |
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.
-rw-r--r-- | rel/files/eunit.ini | 4 | ||||
-rw-r--r-- | rel/plugins/eunit_plugin.erl | 4 | ||||
-rw-r--r-- | setup_eunit.template | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/rel/files/eunit.ini b/rel/files/eunit.ini index 361ea6669..8c203bab4 100644 --- a/rel/files/eunit.ini +++ b/rel/files/eunit.ini @@ -30,9 +30,9 @@ port = 0 [log] ; log to a file to save our terminals from log spam writer = file -file = couch.log +file = {{log_dir}}/couch.log level = info [replicator] ; disable jitter to reduce test run times -startup_jitter = 0
\ No newline at end of file +startup_jitter = 0 diff --git a/rel/plugins/eunit_plugin.erl b/rel/plugins/eunit_plugin.erl index 8f298db5f..356f4e0f7 100644 --- a/rel/plugins/eunit_plugin.erl +++ b/rel/plugins/eunit_plugin.erl @@ -31,12 +31,14 @@ build_eunit_config(Config0, AppFile) -> ViewIndexDir = Cwd ++ "/tmp/data", StateDir = Cwd ++ "/tmp/data", TmpDataDir = Cwd ++ "/tmp/tmp_data", + LogDir = Cwd ++ "/tmp", cleanup_dirs([DataDir, TmpDataDir]), Config1 = rebar_config:set_global(Config0, template, "setup_eunit"), Config2 = rebar_config:set_global(Config1, prefix, Cwd), Config3 = rebar_config:set_global(Config2, data_dir, DataDir), Config4 = rebar_config:set_global(Config3, view_index_dir, ViewIndexDir), - Config = rebar_config:set_global(Config4, state_dir, StateDir), + Config5 = rebar_config:set_global(Config4, log_dir, LogDir), + Config = rebar_config:set_global(Config5, state_dir, StateDir), rebar_templater:create(Config, AppFile). cleanup_dirs(Dirs) -> diff --git a/setup_eunit.template b/setup_eunit.template index ceef60d12..11eee4458 100644 --- a/setup_eunit.template +++ b/setup_eunit.template @@ -8,7 +8,8 @@ {data_dir, "/tmp"}, {prefix, "/tmp"}, {view_index_dir, "/tmp"}, - {state_dir, "/tmp"} + {state_dir, "/tmp"}, + {log_dir, "/tmp"} ]}. {dir, "tmp"}. {dir, "tmp/etc"}. |