You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/07/13 19:58:06 UTC

config commit: updated refs/heads/master to edd59c6

Repository: couchdb-config
Updated Branches:
  refs/heads/master c5a42b52f -> edd59c6b6


Replace couch_log calls with mocks

Depending on the order of test suite invocations its possible that the
config suite will end up with -DTEST compiled versions from couch_log's
eunit test suite. These have syncrhonous calls where the normal versions
are all gen_server:cast/2 calls. This breaks config's test suite when
since couch_log is not started.

Rather than go through the hoops of getting couch_log started (which
causes a circular dependency) I've just mocked out the calls so that
they don't cause issues.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-config/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-config/commit/edd59c6b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-config/tree/edd59c6b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-config/diff/edd59c6b

Branch: refs/heads/master
Commit: edd59c6b6e6c645ceb94b39d76d8b05a92b525d8
Parents: c5a42b5
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Jul 13 14:56:14 2017 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Thu Jul 13 14:56:14 2017 -0500

----------------------------------------------------------------------
 test/config_tests.erl | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-config/blob/edd59c6b/test/config_tests.erl
----------------------------------------------------------------------
diff --git a/test/config_tests.erl b/test/config_tests.erl
index 7e39b9a..3e7e01f 100644
--- a/test/config_tests.erl
+++ b/test/config_tests.erl
@@ -66,6 +66,10 @@ setup({persistent, Chain}) ->
     setup(Chain ++ [?CONFIG_FIXTURE_TEMP]);
 
 setup(Chain) ->
+    meck:new(couch_log),
+    meck:expect(couch_log, error, fun(_, _) -> ok end),
+    meck:expect(couch_log, notice, fun(_, _) -> ok end),
+    meck:expect(couch_log, debug, fun(_, _) -> ok end),
     ok = application:set_env(config, ini_files, Chain),
     test_util:start_applications([config]).
 
@@ -90,6 +94,7 @@ teardown({Apps, Pid}) when is_pid(Pid) ->
     teardown(Apps);
 
 teardown(Apps) when is_list(Apps) ->
+    meck:unload(),
     test_util:stop_applications(Apps).
 
 teardown(_, {Apps, Pid}) when is_pid(Pid) ->