couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject [31/50] git commit: Fix check of conflicts for replication tests
Date Sun, 22 Jan 2012 23:43:13 GMT
Fix check of conflicts for replication tests

The conflicts option belongs to couch_db:open_doc/3 and not
to couch_doc:to_json_obj/2. Also added the deleted_conflicts
option.


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

Branch: refs/heads/COUCHDB-1342
Commit: b64643a3ee4a3148f9d70fa38ea5a8b0e55650a1
Parents: 1054f94
Author: Filipe David Borba Manana <fdmanana@apache.org>
Authored: Sat Jan 7 12:44:16 2012 +0000
Committer: Filipe David Borba Manana <fdmanana@apache.org>
Committed: Sat Jan 7 12:46:04 2012 +0000

----------------------------------------------------------------------
 .../test/05-replication-many-leaves.t              |    8 ++++----
 src/couch_replicator/test/06-doc-missing-stubs.t   |   10 ++++++----
 2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b64643a3/src/couch_replicator/test/05-replication-many-leaves.t
----------------------------------------------------------------------
diff --git a/src/couch_replicator/test/05-replication-many-leaves.t b/src/couch_replicator/test/05-replication-many-leaves.t
index 22c7df8..d8d3eb9 100755
--- a/src/couch_replicator/test/05-replication-many-leaves.t
+++ b/src/couch_replicator/test/05-replication-many-leaves.t
@@ -170,13 +170,13 @@ verify_target(SourceDb, TargetDb, [{DocId, RevList} | Rest]) ->
         TargetDb,
         DocId,
         RevList,
-        []),
+        [conflicts, deleted_conflicts]),
     Docs = [Doc || {ok, Doc} <- Lookups],
     {ok, SourceLookups} = couch_db:open_doc_revs(
         SourceDb,
         DocId,
         RevList,
-        []),
+        [conflicts, deleted_conflicts]),
     SourceDocs = [Doc || {ok, Doc} <- SourceLookups],
     Total = doc_num_conflicts(DocId) + 1,
     etap:is(
@@ -186,8 +186,8 @@ verify_target(SourceDb, TargetDb, [{DocId, RevList} | Rest]) ->
     etap:diag("Verifying all revisions of document " ++ ?b2l(DocId)),
     lists:foreach(
         fun({#doc{id = Id, revs = Revs} = TgtDoc, #doc{id = Id, revs = Revs} = SrcDoc}) ->
-            SourceJson = couch_doc:to_json_obj(SrcDoc, [attachments, conflicts]),
-            TargetJson = couch_doc:to_json_obj(TgtDoc, [attachments, conflicts]),
+            SourceJson = couch_doc:to_json_obj(SrcDoc, [attachments]),
+            TargetJson = couch_doc:to_json_obj(TgtDoc, [attachments]),
             case TargetJson of
             SourceJson ->
                 ok;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b64643a3/src/couch_replicator/test/06-doc-missing-stubs.t
----------------------------------------------------------------------
diff --git a/src/couch_replicator/test/06-doc-missing-stubs.t b/src/couch_replicator/test/06-doc-missing-stubs.t
index 04ec021..e17efc9 100755
--- a/src/couch_replicator/test/06-doc-missing-stubs.t
+++ b/src/couch_replicator/test/06-doc-missing-stubs.t
@@ -163,18 +163,20 @@ compare_dbs(Source, Target) ->
     {ok, TargetDb} = couch_db:open_int(couch_db:name(Target), []),
 
     Fun = fun(FullDocInfo, _, Acc) ->
-        {ok, DocSource} = couch_db:open_doc(SourceDb, FullDocInfo),
+        {ok, DocSource} = couch_db:open_doc(
+            SourceDb, FullDocInfo, [conflicts, deleted_conflicts]),
         Id = DocSource#doc.id,
 
         etap:diag("Verifying document " ++ ?b2l(Id)),
 
-        {ok, DocTarget} = couch_db:open_doc(TargetDb, Id),
+        {ok, DocTarget} = couch_db:open_doc(
+            TargetDb, Id, [conflicts, deleted_conflicts]),
         etap:is(DocTarget#doc.body, DocSource#doc.body,
             "Same body in source and target databases"),
 
         etap:is(
-            couch_doc:to_json_obj(DocTarget, [conflicts, deleted_conflicts]),
-            couch_doc:to_json_obj(DocSource, [conflicts, deleted_conflicts]),
+            couch_doc:to_json_obj(DocTarget, []),
+            couch_doc:to_json_obj(DocSource, []),
             "Same doc body in source and target databases"),
 
         #doc{atts = SourceAtts} = DocSource,


Mime
View raw message