This is an automated email from the ASF dual-hosted git repository. jan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 71cf9f4b53728bd5df5f5b5cc349187ca9da67bb Author: jjrodrig <[email protected]> AuthorDate: Mon Jul 9 23:10:42 2018 +0200 Adjust deletion tests in different cluster quorum conditions --- .../tests-cluster/with-quorum/db-deletion.js | 30 ---------------------- .../tests-cluster/with-quorum/db_deletion.js | 12 ++++++--- .../tests-cluster/without-quorum/db-deletion.js | 30 ---------------------- .../tests-cluster/without-quorum/db_deletion.js | 16 +++++++----- .../db_deletion_overridden_quorum.js | 8 ++---- 5 files changed, 20 insertions(+), 76 deletions(-) diff --git a/test/javascript/tests-cluster/with-quorum/db-deletion.js b/test/javascript/tests-cluster/with-quorum/db-deletion.js deleted file mode 100644 index 079fb49..0000000 --- a/test/javascript/tests-cluster/with-quorum/db-deletion.js +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -// Do DB deletion under cluster with quorum conditions. -couchTests.db_deletion = function(debug) { - - if (debug) debugger; - - var db_name = get_random_db_name() - var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); - - db.createDb(); - - // DB Deletion should return 202 - Acceted as the custer is not complete - xhr = CouchDB.request("DELETE", "/" + db_name + "/"); - T(xhr.status == 202); - -// DB Deletion should return 404 - Not found - xhr = CouchDB.request("DELETE", "/not-existing-db/"); - T(xhr.status == 404); -}; diff --git a/test/javascript/tests-cluster/with-quorum/db_deletion.js b/test/javascript/tests-cluster/with-quorum/db_deletion.js index bef4cae..079fb49 100644 --- a/test/javascript/tests-cluster/with-quorum/db_deletion.js +++ b/test/javascript/tests-cluster/with-quorum/db_deletion.js @@ -10,15 +10,21 @@ // License for the specific language governing permissions and limitations under // the License. -// Do DB deletion in a cluster with quorum conditions. +// Do DB deletion under cluster with quorum conditions. couchTests.db_deletion = function(debug) { if (debug) debugger; var db_name = get_random_db_name() var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); + db.createDb(); - db.deleteDb(); - T(db.last_req.status="200","Should return 200"); + // DB Deletion should return 202 - Acceted as the custer is not complete + xhr = CouchDB.request("DELETE", "/" + db_name + "/"); + T(xhr.status == 202); + +// DB Deletion should return 404 - Not found + xhr = CouchDB.request("DELETE", "/not-existing-db/"); + T(xhr.status == 404); }; diff --git a/test/javascript/tests-cluster/without-quorum/db-deletion.js b/test/javascript/tests-cluster/without-quorum/db-deletion.js deleted file mode 100644 index 006345e..0000000 --- a/test/javascript/tests-cluster/without-quorum/db-deletion.js +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -// Do DB creation under cluster with quorum conditions. -couchTests.db_deletion = function(debug) { - - if (debug) debugger; - - var db_name = get_random_db_name() - var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); - - db.createDb(); - - // DB Deletion should return 202 - Acepted - xhr = CouchDB.request("DELETE", "/" + db_name + "/"); - T(xhr.status == 202); - - // DB Deletion should return 404 - Not found - xhr = CouchDB.request("DELETE", "/not-existing-db/"); - T(xhr.status == 404); -}; diff --git a/test/javascript/tests-cluster/without-quorum/db_deletion.js b/test/javascript/tests-cluster/without-quorum/db_deletion.js index 04b15c0..006345e 100644 --- a/test/javascript/tests-cluster/without-quorum/db_deletion.js +++ b/test/javascript/tests-cluster/without-quorum/db_deletion.js @@ -10,19 +10,21 @@ // License for the specific language governing permissions and limitations under // the License. -// Do DB deletion in a cluster with quorum conditions. +// Do DB creation under cluster with quorum conditions. couchTests.db_deletion = function(debug) { if (debug) debugger; var db_name = get_random_db_name() var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); - db.createDb(); - //db.deleteDb(); - // TODO DB deletions fails if the quorum is not met. + db.createDb(); + + // DB Deletion should return 202 - Acepted xhr = CouchDB.request("DELETE", "/" + db_name + "/"); - //T(db.last_req.status="202","Should return 202"); - console.log("Skipped-TODO: Fix issue 500 Error on delete. 202->"+xhr.status) - + T(xhr.status == 202); + + // DB Deletion should return 404 - Not found + xhr = CouchDB.request("DELETE", "/not-existing-db/"); + T(xhr.status == 404); }; diff --git a/test/javascript/tests-cluster/without-quorum/db_deletion_overridden_quorum.js b/test/javascript/tests-cluster/without-quorum/db_deletion_overridden_quorum.js index 4a1efce..11b344c 100644 --- a/test/javascript/tests-cluster/without-quorum/db_deletion_overridden_quorum.js +++ b/test/javascript/tests-cluster/without-quorum/db_deletion_overridden_quorum.js @@ -19,11 +19,7 @@ couchTests.db_deletion_overridden_quorum = function(debug) { var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"},{"w":1}); db.createDb(); - - //db.deleteDb(); - // TODO DB deletions fails if the quorum is not met. + // DB deletions does not consider overriden quorum param. xhr = CouchDB.request("DELETE", "/" + db_name + "/"); - //T(db.last_req.status="200","Should return 200"); - console.log("Skipped-TODO: Fix issue 500 Error on delete - Not considering overriden quorum. 200->"+xhr.status); - + T(db.last_req.status="202","Should return 202"); };
