couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couchdb commit: updated refs/heads/master to e37167d
Date Tue, 21 Jun 2016 21:17:38 GMT
Repository: couchdb
Updated Branches:
  refs/heads/master e8b49c9ea -> e37167dbb


support update_seq in _all_docs

Tests improved but don't pass, bulkSave seems async.


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

Branch: refs/heads/master
Commit: e37167dbbd33e9c86bb02b09783660dcbdf6cae6
Parents: e8b49c9
Author: Robert Newson <rnewson@apache.org>
Authored: Tue Jun 21 21:18:03 2016 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue Jun 21 22:16:59 2016 +0100

----------------------------------------------------------------------
 rebar.config.script                      |  2 +-
 test/javascript/tests/view_update_seq.js | 34 +++++++++++++++++----------
 2 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e37167db/rebar.config.script
----------------------------------------------------------------------
diff --git a/rebar.config.script b/rebar.config.script
index 5c2af09..e071368 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -42,7 +42,7 @@ DepDescs = [
 {docs,             "documentation",    "2dda387ea5cc21861d8797ea2c8a82c3b439d55f", [raw]},
 {ddoc_cache,       "ddoc-cache",       "c762e90a33ce3cda19ef142dd1120f1087ecd876"},
 {ets_lru,          "ets-lru",          "c05488c8b1d7ec1c3554a828e0c9bf2888932ed6"},
-{fabric,           "fabric",           "18e6fd852e7442ad957950daaaa7ee11d49255ea"},
+{fabric,           "fabric",           "37bcda9c336bd4d8064a498f84122feeb74abf44"},
 {fauxton,          "fauxton",          {tag, "v1.1.2"}, [raw]},
 {folsom,           "folsom",           "a5c95dec18227c977029fbd3b638966d98f17003"},
 {global_changes,   "global-changes",   "203fb088ed81149108e64d18ffd9c3f5df154f97"},

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e37167db/test/javascript/tests/view_update_seq.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/view_update_seq.js b/test/javascript/tests/view_update_seq.js
index 3012014..a74b08d 100644
--- a/test/javascript/tests/view_update_seq.js
+++ b/test/javascript/tests/view_update_seq.js
@@ -11,7 +11,6 @@
 // the License.
 
 couchTests.view_update_seq = function(debug) {
-  return console.log("TODO: update_seq for _all_docs not implemented yet");
   var db_name = get_random_db_name();
   var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
   db.createDb();
@@ -37,14 +36,23 @@ couchTests.view_update_seq = function(debug) {
       }
     }
   };
+
+  var seqInt = function(val) {
+    if (typeof(val) === 'string') {
+      return parseInt(val.split('-')[0]);
+    } else {
+      return val;
+    }
+  };
+
   T(db.save(designDoc).ok);
 
-  T(db.info().update_seq == 1);
+  TEquals(1, seqInt(db.info().update_seq));
 
   resp = db.allDocs({update_seq:true});
 
   T(resp.rows.length == 1);
-  T(resp.update_seq == 1);
+  TEquals(1, seqInt(resp.update_seq));
 
   var docs = makeDocs(0, 100);
   db.bulkSave(docs);
@@ -55,11 +63,11 @@ couchTests.view_update_seq = function(debug) {
 
   resp = db.allDocs({limit: 1, update_seq:true});
   T(resp.rows.length == 1);
-  T(resp.update_seq == 101);
+  TEquals(101, seqInt(resp.update_seq));
 
   resp = db.view('test/all_docs', {limit: 1, update_seq:true});
   T(resp.rows.length == 1);
-  T(resp.update_seq == 101);
+  TEquals(101, seqInt(resp.update_seq));
 
   resp = db.view('test/all_docs', {limit: 1, update_seq:false});
   T(resp.rows.length == 1);
@@ -67,18 +75,18 @@ couchTests.view_update_seq = function(debug) {
 
   resp = db.view('test/summate', {update_seq:true});
   T(resp.rows.length == 1);
-  T(resp.update_seq == 101);
+  TEquals(101, seqInt(resp.update_seq));
 
   db.save({"id":"0", "integer": 1});
   resp = db.view('test/all_docs', {limit: 1,stale: "ok", update_seq:true});
   T(resp.rows.length == 1);
-  T(resp.update_seq == 101);
+  TEquals(101, seqInt(resp.update_seq));
 
   db.save({"id":"00", "integer": 2});
   resp = db.view('test/all_docs',
     {limit: 1, stale: "update_after", update_seq: true});
   T(resp.rows.length == 1);
-  T(resp.update_seq == 101);
+  TEquals(101, seqInt(resp.update_seq));
 
   // wait 5 seconds for the next assertions to pass in very slow machines
   var t0 = new Date(), t1;
@@ -89,20 +97,20 @@ couchTests.view_update_seq = function(debug) {
 
   resp = db.view('test/all_docs', {limit: 1, stale: "ok", update_seq: true});
   T(resp.rows.length == 1);
-  T(resp.update_seq == 103);
+  TEquals(103, seqInt(resp.update_seq));
 
   resp = db.view('test/all_docs', {limit: 1, update_seq:true});
   T(resp.rows.length == 1);
-  T(resp.update_seq == 103);
+  TEquals(103, seqInt(resp.update_seq));
 
   resp = db.view('test/all_docs',{update_seq:true},["0","1"]);
-  T(resp.update_seq == 103);
+  TEquals(103, seqInt(resp.update_seq));
 
   resp = db.view('test/all_docs',{update_seq:true},["0","1"]);
-  T(resp.update_seq == 103);
+  TEquals(103, seqInt(resp.update_seq));
 
   resp = db.view('test/summate',{group:true, update_seq:true},[0,1]);
-  TEquals(103, resp.update_seq);
+  TEquals(103, seqInt(resp.update_seq));
 
   // cleanup
   db.deleteDb();


Mime
View raw message