couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [13/16] couchdb commit: updated refs/heads/2876-js-tests to 805a427
Date Wed, 11 Nov 2015 22:50:29 GMT
Conflict and design doc tests


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

Branch: refs/heads/2876-js-tests
Commit: a5694c1d51f4a9ed59608f54372b0059fbeb5a52
Parents: c24b594
Author: sebastianro <sebastianro@apache.org>
Authored: Sat Oct 17 17:36:13 2015 +0200
Committer: sebastianro <sebastianro@apache.org>
Committed: Sat Oct 17 17:36:13 2015 +0200

----------------------------------------------------------------------
 test/javascript/tests/conflicts.js      |  6 +++---
 test/javascript/tests/design_docs.js    | 10 ++++++----
 test/javascript/tests/design_options.js | 19 ++++++++++---------
 3 files changed, 19 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/a5694c1d/test/javascript/tests/conflicts.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/conflicts.js b/test/javascript/tests/conflicts.js
index 75fa5ac..c6c29c8 100644
--- a/test/javascript/tests/conflicts.js
+++ b/test/javascript/tests/conflicts.js
@@ -12,7 +12,6 @@
 
 // Do some edit conflict detection tests
 couchTests.conflicts = function(debug) {
-  return console.log('TODO');
   var db_name = get_random_db_name();
   var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
   db.createDb();
@@ -104,8 +103,9 @@ couchTests.conflicts = function(debug) {
   T(db.save(r2).ok);
   T(db.save(r3).ok);
 
-  T(db.compact().ok);
-  while (db.info().compact_running) {};
+  // we can't compact clustered DBs, but the tests will be meaningful still w/out
+  //T(db.compact().ok);
+  //while (db.info().compact_running) {};
 
   TEquals({"_id":"doc",
         "_rev":"3-cc2f3210d779aef595cd4738be0ef8ff",

http://git-wip-us.apache.org/repos/asf/couchdb/blob/a5694c1d/test/javascript/tests/design_docs.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/design_docs.js b/test/javascript/tests/design_docs.js
index bbc48d2..6c46437 100644
--- a/test/javascript/tests/design_docs.js
+++ b/test/javascript/tests/design_docs.js
@@ -11,7 +11,6 @@
 // the License.
 
 couchTests.design_docs = function(debug) {
-  return console.log('TODO');
   var db_name = get_random_db_name();
   var db_name_a = get_random_db_name();
   var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
@@ -22,6 +21,7 @@ couchTests.design_docs = function(debug) {
   db.createDb();
   db2.createDb();
 
+/*
   var server_config = [
     {
       section: "query_server_config",
@@ -29,8 +29,9 @@ couchTests.design_docs = function(debug) {
       value: "false"
     }
   ];
+*/
 
-  var testFun = function() {
+  // var testFun = function() {
     var numDocs = 500;
 
     function makebigstring(power) {
@@ -418,9 +419,10 @@ couchTests.design_docs = function(debug) {
 
     // trigger ddoc cleanup
     T(db.viewCleanup().ok);
-  }; // enf of testFun
+  //}; // enf of testFun
 
-  run_on_modified_server(server_config, testFun);
+  // not used now as we don't have modifications so far (would have to put them in)
+  //run_on_modified_server(server_config, testFun);
 
   // COUCHDB-1227 - if a design document is deleted, by adding a "_deleted"
   // field with the boolean value true, its validate_doc_update functions

http://git-wip-us.apache.org/repos/asf/couchdb/blob/a5694c1d/test/javascript/tests/design_options.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/design_options.js b/test/javascript/tests/design_options.js
index f25cff6..9e602dc 100644
--- a/test/javascript/tests/design_options.js
+++ b/test/javascript/tests/design_options.js
@@ -11,7 +11,6 @@
 // the License.
 
 couchTests.design_options = function(debug) {
-  return console.log('TODO');
   var db_name = get_random_db_name();
   var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
   db.createDb();
@@ -37,12 +36,13 @@ couchTests.design_options = function(debug) {
   T(db.save(designDoc).ok);
 
   // should work for temp views
-  var rows = db.query(map, null, {options:{include_design: true}}).rows;
-  T(rows.length == 1);
-  T(rows[0].value == "_design/fu");
-
-  rows = db.query(map).rows;
-  T(rows.length == 0);
+  // no more there on cluster - pointless test 
+  //var rows = db.query(map, null, {options:{include_design: true}}).rows;
+  //T(rows.length == 1);
+  //T(rows[0].value == "_design/fu");
+  //
+  //rows = db.query(map).rows;
+  //T(rows.length == 0);
 
   // when true, should include design docs in views
   rows = db.view("fu/data").rows;
@@ -68,8 +68,9 @@ couchTests.design_options = function(debug) {
   // should also have local_seq in the view
   var resp = db.save({});
   rows = db.view("fu/with_seq").rows;
-  T(rows[0].key == 1)
-  T(rows[1].key == 2)
+  // format is more complex on cluster now
+  T(!!rows[0].key)
+  T(!!rows[1].key)
   var doc = db.open(resp.id);
   db.deleteDoc(doc);
 };


Mime
View raw message