couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [couchdb] branch 1.x.x updated: disable js tests that need the native query server
Date Wed, 01 Nov 2017 07:49:00 GMT
This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch 1.x.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/1.x.x by this push:
     new bf6b6a1  disable js tests that need the native query server
bf6b6a1 is described below

commit bf6b6a1c84321baee2c4ad354059a45e0b8fdec7
Author: Jan Lehnardt <jan@apache.org>
AuthorDate: Tue Oct 31 21:01:15 2017 +0100

    disable js tests that need the native query server
---
 share/www/script/test/changes.js      | 199 +++++++++++++++++-----------------
 share/www/script/test/erlang_views.js |  13 ++-
 share/www/script/test/list_views.js   |  17 +--
 3 files changed, 116 insertions(+), 113 deletions(-)

diff --git a/share/www/script/test/changes.js b/share/www/script/test/changes.js
index 0fba9f9..55602d5 100644
--- a/share/www/script/test/changes.js
+++ b/share/www/script/test/changes.js
@@ -447,106 +447,107 @@ couchTests.changes = function(debug) {
   resp = JSON.parse(req.responseText);
   T(resp.results.length == 1, "filter=changes_filter/conflicted");
 
+  // diabled because of https://github.com/apache/couchdb/pull/939
   // test with erlang filter function
-  run_on_modified_server([{
-    section: "native_query_servers",
-    key: "erlang",
-    value: "{couch_native_process, start_link, []}"
-  }], function() {
-    var erl_ddoc = {
-      _id: "_design/erlang",
-      language: "erlang",
-      filters: {
-        foo:
-          'fun({Doc}, Req) -> ' +
-          '  case couch_util:get_value(<<"value">>, Doc) of' +
-          '  undefined -> false;' +
-          '  Value -> (Value rem 2) =:= 0;' +
-          '  _ -> false' +
-          '  end ' +
-          'end.'
-      }
-    };
-
-    db.deleteDb();
-    db.createDb();
-    T(db.save(erl_ddoc).ok);
-
-    var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=erlang/foo");
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 0);
-
-    T(db.save({_id: "doc1", value : 1}).ok);
-    T(db.save({_id: "doc2", value : 2}).ok);
-    T(db.save({_id: "doc3", value : 3}).ok);
-    T(db.save({_id: "doc4", value : 4}).ok);
-
-    var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=erlang/foo");
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 2);
-    T(resp.results[0].id === "doc2");
-    T(resp.results[1].id === "doc4");
-
-    // test filtering on docids
-    //
-
-    var options = {
-        headers: {"Content-Type": "application/json"},
-        body: JSON.stringify({"doc_ids": ["something", "anotherthing", "andmore"]})
-    };
-
-    var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 0);
-
-    T(db.save({"_id":"something", "bop" : "plankton"}).ok);
-    var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 1);
-    T(resp.results[0].id === "something");
-
-    T(db.save({"_id":"anotherthing", "bop" : "plankton"}).ok);
-    var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 2);
-    T(resp.results[0].id === "something");
-    T(resp.results[1].id === "anotherthing");
-
-    var docids = JSON.stringify(["something", "anotherthing", "andmore"]),
-        req = CouchDB.request("GET", "/test_suite_db/_changes?filter=_doc_ids&doc_ids="+docids,
options);
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 2);
-    T(resp.results[0].id === "something");
-    T(resp.results[1].id === "anotherthing");
-
-    var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=_design");
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 1);
-    T(resp.results[0].id === "_design/erlang");
-
-
-    if (!is_safari && xhr) {
-        // filter docids with continuous
-        xhr = CouchDB.newXhr();
-        xhr.open("POST", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&timeout=500&since=7&filter=_doc_ids"),
true);
-        xhr.setRequestHeader("Content-Type", "application/json");
-
-        xhr.send(options.body);
-
-        T(db.save({"_id":"andmore", "bop" : "plankton"}).ok);
-
-        waitForSuccess(function() {
-            if (xhr.readyState != 4) {
-              throw("still waiting");
-            }
-            return true;
-        }, "andmore-only");
-
-        var line = JSON.parse(xhr.responseText.split("\n")[0]);
-        T(line.seq == 8);
-        T(line.id == "andmore");
-    }
-  });
+  // run_on_modified_server([{
+  //   section: "native_query_servers",
+  //   key: "erlang",
+  //   value: "{couch_native_process, start_link, []}"
+  // }], function() {
+  //   var erl_ddoc = {
+  //     _id: "_design/erlang",
+  //     language: "erlang",
+  //     filters: {
+  //       foo:
+  //         'fun({Doc}, Req) -> ' +
+  //         '  case couch_util:get_value(<<"value">>, Doc) of' +
+  //         '  undefined -> false;' +
+  //         '  Value -> (Value rem 2) =:= 0;' +
+  //         '  _ -> false' +
+  //         '  end ' +
+  //         'end.'
+  //     }
+  //   };
+  //
+  //   db.deleteDb();
+  //   db.createDb();
+  //   T(db.save(erl_ddoc).ok);
+  //
+  //   var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=erlang/foo");
+  //   var resp = JSON.parse(req.responseText);
+  //   T(resp.results.length === 0);
+  //
+  //   T(db.save({_id: "doc1", value : 1}).ok);
+  //   T(db.save({_id: "doc2", value : 2}).ok);
+  //   T(db.save({_id: "doc3", value : 3}).ok);
+  //   T(db.save({_id: "doc4", value : 4}).ok);
+  //
+  //   var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=erlang/foo");
+  //   var resp = JSON.parse(req.responseText);
+  //   T(resp.results.length === 2);
+  //   T(resp.results[0].id === "doc2");
+  //   T(resp.results[1].id === "doc4");
+  //
+  //   // test filtering on docids
+  //   //
+  //
+  //   var options = {
+  //       headers: {"Content-Type": "application/json"},
+  //       body: JSON.stringify({"doc_ids": ["something", "anotherthing", "andmore"]})
+  //   };
+  //
+  //   var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
+  //   var resp = JSON.parse(req.responseText);
+  //   T(resp.results.length === 0);
+  //
+  //   T(db.save({"_id":"something", "bop" : "plankton"}).ok);
+  //   var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
+  //   var resp = JSON.parse(req.responseText);
+  //   T(resp.results.length === 1);
+  //   T(resp.results[0].id === "something");
+  //
+  //   T(db.save({"_id":"anotherthing", "bop" : "plankton"}).ok);
+  //   var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
+  //   var resp = JSON.parse(req.responseText);
+  //   T(resp.results.length === 2);
+  //   T(resp.results[0].id === "something");
+  //   T(resp.results[1].id === "anotherthing");
+  //
+  //   var docids = JSON.stringify(["something", "anotherthing", "andmore"]),
+  //       req = CouchDB.request("GET", "/test_suite_db/_changes?filter=_doc_ids&doc_ids="+docids,
options);
+  //   var resp = JSON.parse(req.responseText);
+  //   T(resp.results.length === 2);
+  //   T(resp.results[0].id === "something");
+  //   T(resp.results[1].id === "anotherthing");
+  //
+  //   var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=_design");
+  //   var resp = JSON.parse(req.responseText);
+  //   T(resp.results.length === 1);
+  //   T(resp.results[0].id === "_design/erlang");
+  //
+  //
+  //   if (!is_safari && xhr) {
+  //       // filter docids with continuous
+  //       xhr = CouchDB.newXhr();
+  //       xhr.open("POST", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&timeout=500&since=7&filter=_doc_ids"),
true);
+  //       xhr.setRequestHeader("Content-Type", "application/json");
+  //
+  //       xhr.send(options.body);
+  //
+  //       T(db.save({"_id":"andmore", "bop" : "plankton"}).ok);
+  //
+  //       waitForSuccess(function() {
+  //           if (xhr.readyState != 4) {
+  //             throw("still waiting");
+  //           }
+  //           return true;
+  //       }, "andmore-only");
+  //
+  //       var line = JSON.parse(xhr.responseText.split("\n")[0]);
+  //       T(line.seq == 8);
+  //       T(line.id == "andmore");
+  //   }
+  // });
 
   // COUCHDB-1037 - empty result for ?limit=1&filter=foo/bar in some cases
   T(db.deleteDb());
diff --git a/share/www/script/test/erlang_views.js b/share/www/script/test/erlang_views.js
index 7eddab4..3a27ae3 100644
--- a/share/www/script/test/erlang_views.js
+++ b/share/www/script/test/erlang_views.js
@@ -11,6 +11,7 @@
 // the License.
 
 couchTests.erlang_views = function(debug) {
+  return; // diabled because of https://github.com/apache/couchdb/pull/939
   var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
   db.deleteDb();
   db.createDb();
@@ -40,7 +41,7 @@ couchTests.erlang_views = function(debug) {
       T(results.total_rows == 1);
       T(results.rows[0].key == 1);
       T(results.rows[0].value == "str1");
-      
+
       // check simple reduction - another doc with same key.
       var doc = {_id: "2", integer: 1, string: "str2"};
       T(db.save(doc).ok);
@@ -99,7 +100,7 @@ couchTests.erlang_views = function(debug) {
       db.deleteDb();
       db.createDb();
       var words = "foo bar abc def baz xxyz".split(/\s+/);
-      
+
       var docs = [];
       for(var i = 0; i < 250; i++) {
         var body = [];
@@ -115,16 +116,16 @@ couchTests.erlang_views = function(debug) {
         });
       }
       T(db.bulkSave(docs).length, 250, "Saved big doc set.");
-      
+
       var mfun = 'fun({Doc}) -> ' +
         'Words = couch_util:get_value(<<"words">>, Doc), ' +
         'lists:foreach(fun({Word}) -> ' +
-            'WordString = couch_util:get_value(<<"word">>, Word), ' + 
-            'Count = couch_util:get_value(<<"count">>, Word), ' + 
+            'WordString = couch_util:get_value(<<"word">>, Word), ' +
+            'Count = couch_util:get_value(<<"count">>, Word), ' +
             'Emit(WordString , Count) ' +
           'end, Words) ' +
         'end.';
-      
+
       var rfun = 'fun(Keys, Values, RR) -> length(Values) end.';
       var results = db.query(mfun, rfun, null, null, "erlang");
       T(results.rows[0].key === null, "Returned a reduced value.");
diff --git a/share/www/script/test/list_views.js b/share/www/script/test/list_views.js
index ece81ea..66f20bc 100644
--- a/share/www/script/test/list_views.js
+++ b/share/www/script/test/list_views.js
@@ -221,7 +221,7 @@ couchTests.list_views = function(debug) {
     headers: {"if-none-match": etag}
   });
   T(xhr.status == 304);
-  
+
   // confirm ETag changes with different POST bodies
   xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/basicBasic/basicView",
     {body: JSON.stringify({keys:[1]})}
@@ -240,7 +240,7 @@ couchTests.list_views = function(debug) {
   TEquals(10, resp.head.total_rows);
   TEquals(0, resp.head.offset);
   TEquals(11, resp.head.update_seq);
-  
+
   T(resp.rows.length == 10);
   TEquals(resp.rows[0], {"id": "0","key": 0,"value": "0"});
 
@@ -414,7 +414,7 @@ couchTests.list_views = function(debug) {
   xhr = CouchDB.request("POST", url, {
     body: '{"keys":[-2,-4,-5,-7]}'
   });
-  
+
   T(xhr.status == 200, "multi key separate docs");
   T(!(/Key: -3/.test(xhr.responseText)));
   T(/Key: -7/.test(xhr.responseText));
@@ -441,11 +441,12 @@ couchTests.list_views = function(debug) {
     }
   };
 
-  run_on_modified_server([{
-    section: "native_query_servers",
-    key: "erlang",
-    value: "{couch_native_process, start_link, []}"
-  }], erlViewTest);
+  // diabled because of https://github.com/apache/couchdb/pull/939
+  // run_on_modified_server([{
+  //   section: "native_query_servers",
+  //   key: "erlang",
+  //   value: "{couch_native_process, start_link, []}"
+  // }], erlViewTest);
 
   // COUCHDB-1113
   var ddoc = {

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <commits@couchdb.apache.org>'].

Mime
View raw message