You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2021/06/11 18:50:09 UTC

[couchdb-erlfdb] branch main updated: Ensure application environment is loaded (#26)

This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-erlfdb.git


The following commit(s) were added to refs/heads/main by this push:
     new 44a9bff  Ensure application environment is loaded (#26)
44a9bff is described below

commit 44a9bffa0786579f1e798a0bc6610aa11dfb9ba9
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Fri Jun 11 14:50:00 2021 -0400

    Ensure application environment is loaded (#26)
    
    erlfdb is a library application, but starting the app is still
    required to make the application environment variables accessible.
    Without this hack the `test_cluster_file` setting has no effect during
    eunit test executions.
---
 src/erlfdb_util.erl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/erlfdb_util.erl b/src/erlfdb_util.erl
index 4dbbc7d..58fa12d 100644
--- a/src/erlfdb_util.erl
+++ b/src/erlfdb_util.erl
@@ -48,6 +48,8 @@ get_test_db(Options) ->
 
 
 init_test_cluster(Options) ->
+    % Hack to ensure erlfdb app environment is loaded during unit tests
+    ok = application:ensure_started(erlfdb),
     case application:get_env(erlfdb, test_cluster_file) of
         {ok, ClusterFile} ->
             {ok, ClusterFile};