You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2015/12/20 13:24:04 UTC

[1/2] couchdb commit: updated refs/heads/master to 3e8d65c

Repository: couchdb
Updated Branches:
  refs/heads/master 98e38cc9f -> 3e8d65c4c


fix uuids.js


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

Branch: refs/heads/master
Commit: 3e8d65c4c1ad88aabbae49e60dc420479ea105ed
Parents: 0ff7cea
Author: Robert Newson <rn...@apache.org>
Authored: Sun Dec 20 12:00:23 2015 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Sun Dec 20 12:03:01 2015 +0000

----------------------------------------------------------------------
 test/javascript/tests/uuids.js | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3e8d65c4/test/javascript/tests/uuids.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/uuids.js b/test/javascript/tests/uuids.js
index 7257d3d..b3ff856 100644
--- a/test/javascript/tests/uuids.js
+++ b/test/javascript/tests/uuids.js
@@ -11,7 +11,6 @@
 // the License.
 
 couchTests.uuids = function(debug) {
-  return console.log("TODO");// TODO 
   var etags = [];
   var testHashBustingHeaders = function(xhr) {
     T(xhr.getResponseHeader("Cache-Control").match(/no-cache/));
@@ -33,9 +32,6 @@ couchTests.uuids = function(debug) {
     //T(currentTime - dateHeader < 3000);
   };
 
-  var db_name = get_random_db_name();
-  var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
-  db.createDb();
   if (debug) debugger;
 
   // a single UUID without an explicit count


[2/2] couchdb commit: updated refs/heads/master to 3e8d65c

Posted by rn...@apache.org.
enhance run_on_modified_server for cluster


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

Branch: refs/heads/master
Commit: 0ff7ceadb1bdda7aa53ab190a7808c79fa274039
Parents: 98e38cc
Author: Robert Newson <rn...@apache.org>
Authored: Sun Dec 20 12:00:11 2015 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Sun Dec 20 12:03:01 2015 +0000

----------------------------------------------------------------------
 test/javascript/couch_test_runner.js | 42 ++++++++++++++++++-------------
 1 file changed, 25 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/0ff7cead/test/javascript/couch_test_runner.js
----------------------------------------------------------------------
diff --git a/test/javascript/couch_test_runner.js b/test/javascript/couch_test_runner.js
index 28367fc..2d0c91e 100644
--- a/test/javascript/couch_test_runner.js
+++ b/test/javascript/couch_test_runner.js
@@ -363,33 +363,41 @@ function makeDocs(start, end, templateDoc) {
 }
 
 function run_on_modified_server(settings, fun) {
-  throw new Error("_config not available on cluster")
+  var xhr = CouchDB.request("GET", "/_membership");
+  var nodes = JSON.parse(xhr.responseText).all_nodes;
   try {
     // set the settings
     for(var i=0; i < settings.length; i++) {
       var s = settings[i];
-      var xhr = CouchDB.request("PUT", "/_config/" + s.section + "/" + s.key, {
-        body: JSON.stringify(s.value),
-        headers: {"X-Couch-Persist": "false"}
-      });
-      CouchDB.maybeThrowError(xhr);
-      s.oldValue = xhr.responseText;
+      for (var n in nodes) {
+        xhr = CouchDB.request("PUT", "/_node/" + nodes[n] + "/_config/" + s.section + "/" + s.key, {
+          body: JSON.stringify(s.value),
+          headers: {"X-Couch-Persist": "false"}
+        });
+        CouchDB.maybeThrowError(xhr);
+        if (typeof s[nodes[n]] === 'undefined') {
+          s[nodes[n]] = {};
+        }
+        s[nodes[n]] = xhr.responseText;
+      }
     }
     // run the thing
     fun();
   } finally {
     // unset the settings
     for(var j=0; j < i; j++) {
-      var s = settings[j];
-      if(s.oldValue == "\"\"\n") { // unset value
-        CouchDB.request("DELETE", "/_config/" + s.section + "/" + s.key, {
-          headers: {"X-Couch-Persist": "false"}
-        });
-      } else {
-        CouchDB.request("PUT", "/_config/" + s.section + "/" + s.key, {
-          body: s.oldValue,
-          headers: {"X-Couch-Persist": "false"}
-        });
+      for (var n in nodes) {
+        var s = settings[j];
+        if(s[nodes[n]] == "\"\"\n") { // unset value
+          CouchDB.request("DELETE", "/_node/" + nodes[n] + "/_config/" + s.section + "/" + s.key, {
+            headers: {"X-Couch-Persist": "false"}
+          });
+        } else {
+          CouchDB.request("PUT", "/_node/" + nodes[n] + "/_config/" + s.section + "/" + s.key, {
+            body: s[nodes[n]],
+            headers: {"X-Couch-Persist": "false"}
+          });
+        }
       }
     }
   }