You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2017/11/01 07:49:02 UTC

[GitHub] janl closed pull request #949: disable js tests that need the native query server

janl closed pull request #949: disable js tests that need the native query server
URL: https://github.com/apache/couchdb/pull/949
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/share/www/script/test/changes.js b/share/www/script/test/changes.js
index 0fba9f9fae..55602d548e 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 7eddab4025..3a27ae3695 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 ece81ea00c..66f20bc22c 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 = {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services