couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject fabric commit: updated refs/heads/master to 25e9da5
Date Wed, 07 Oct 2015 17:55:06 GMT
Repository: couchdb-fabric
Updated Branches:
  refs/heads/master 17f037780 -> 25e9da562


Fix eunit tests.

 Mock couch_log alongside couch_stats.


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

Branch: refs/heads/master
Commit: 25e9da562212f1f67e1face58418dfc82c621b7c
Parents: 17f0377
Author: Nick Vatamaniuc <vatamane@gmail.com>
Authored: Fri Oct 2 14:47:10 2015 -0400
Committer: Nick Vatamaniuc <vatamane@gmail.com>
Committed: Fri Oct 2 14:47:10 2015 -0400

----------------------------------------------------------------------
 src/fabric_doc_open_revs.erl | 8 ++++++--
 src/fabric_doc_update.erl    | 6 ++++++
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/25e9da56/src/fabric_doc_open_revs.erl
----------------------------------------------------------------------
diff --git a/src/fabric_doc_open_revs.erl b/src/fabric_doc_open_revs.erl
index 6295b07..4d493e4 100644
--- a/src/fabric_doc_open_revs.erl
+++ b/src/fabric_doc_open_revs.erl
@@ -199,6 +199,8 @@ all_revs_test() ->
     meck:new([fabric, couch_stats]),
     meck:expect(fabric, update_docs, fun(_, _, _) -> {ok, nil} end),
     meck:expect(couch_stats, increment_counter, fun(_) -> ok end),
+    meck:new(couch_log),
+    meck:expect(couch_log, notice, fun(_,_) -> ok end),
 
     State0 = #state{worker_count = 3, workers=[nil,nil,nil], r = 2, revs = all},
     Foo1 = {ok, #doc{revs = {1, [<<"foo">>]}}},
@@ -243,7 +245,7 @@ all_revs_test() ->
         {stop, [Bar1, Foo1]},
         handle_message({ok, [Bar1]}, nil, State2)
       ),
-    meck:unload([fabric, couch_stats]),
+    meck:unload([fabric, couch_log, couch_stats]),
     config:stop().
 
 specific_revs_test() ->
@@ -251,6 +253,8 @@ specific_revs_test() ->
     meck:new([fabric, couch_stats]),
     meck:expect(fabric, update_docs, fun(_, _, _) -> {ok, nil} end),
     meck:expect(couch_stats, increment_counter, fun(_) -> ok end),
+    meck:new(couch_log),
+    meck:expect(couch_log, notice, fun(_,_) -> ok end),
 
     Revs = [{1,<<"foo">>}, {1,<<"bar">>}, {1,<<"baz">>}],
     State0 = #state{
@@ -313,5 +317,5 @@ specific_revs_test() ->
         {stop, [Foo2, Bar1, Baz2]},
         handle_message({ok, [Foo2, Bar1, Baz2]}, nil, State2L)
       ),
-    meck:unload([fabric, couch_stats]),
+    meck:unload([fabric, couch_log, couch_stats]),
     config:stop().

http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/25e9da56/src/fabric_doc_update.erl
----------------------------------------------------------------------
diff --git a/src/fabric_doc_update.erl b/src/fabric_doc_update.erl
index 58bd355..fc54457 100644
--- a/src/fabric_doc_update.erl
+++ b/src/fabric_doc_update.erl
@@ -216,6 +216,8 @@ validate_atomic_update(_DbName, AllDocs, true) ->
 doc_update1_test() ->
     meck:new(couch_stats),
     meck:expect(couch_stats, increment_counter, fun(_) -> ok end),
+    meck:new(couch_log),
+    meck:expect(couch_log, warning, fun(_,_) -> ok end),
 
     Doc1 = #doc{revs = {1,[<<"foo">>]}},
     Doc2 = #doc{revs = {1,[<<"bar">>]}},
@@ -286,12 +288,15 @@ doc_update1_test() ->
         {error, [{Doc1,{accepted,"A"}},{Doc2,{error,internal_server_error}}]},
         ReplyW5
     ),
+    meck:unload(couch_log),
     meck:unload(couch_stats).
 
 
 doc_update2_test() ->
     meck:new(couch_stats),
     meck:expect(couch_stats, increment_counter, fun(_) -> ok end),
+    meck:new(couch_log),
+    meck:expect(couch_log, warning, fun(_,_) -> ok end),
 
     Doc1 = #doc{revs = {1,[<<"foo">>]}},
     Doc2 = #doc{revs = {1,[<<"bar">>]}},
@@ -315,6 +320,7 @@ doc_update2_test() ->
 
     ?assertEqual({accepted, [{Doc1,{accepted,Doc2}}, {Doc2,{accepted,Doc1}}]},
         Reply),
+    meck:unload(couch_log),
     meck:unload(couch_stats).
 
 doc_update3_test() ->


Mime
View raw message