couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [2/2] couchdb commit: updated refs/heads/master to 3715f37
Date Fri, 18 Dec 2015 10:50:36 GMT
JS test: clean up temp databases after test runs


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

Branch: refs/heads/master
Commit: 3715f376e8f38f4a0ed00b83eedb3d72a6dd3436
Parents: 2fcd46a
Author: Jan Lehnardt <jan@apache.org>
Authored: Fri Dec 18 11:49:54 2015 +0100
Committer: Jan Lehnardt <jan@apache.org>
Committed: Fri Dec 18 11:49:54 2015 +0100

----------------------------------------------------------------------
 test/javascript/tests/attachment_paths.js      | 5 +++--
 test/javascript/tests/attachments_multipart.js | 2 +-
 test/javascript/tests/changes.js               | 9 +++++++--
 test/javascript/tests/conflicts.js             | 1 +
 test/javascript/tests/design_options.js        | 1 +
 test/javascript/tests/design_paths.js          | 5 +++--
 test/javascript/tests/replication.js           | 1 +
 7 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3715f376/test/javascript/tests/attachment_paths.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/attachment_paths.js b/test/javascript/tests/attachment_paths.js
index 3f6ffb7..0599771 100644
--- a/test/javascript/tests/attachment_paths.js
+++ b/test/javascript/tests/attachment_paths.js
@@ -12,11 +12,11 @@
 
 couchTests.attachment_paths = function(debug) {
   if (debug) debugger;
-  var dbNames = ["test_suite_db", "test_suite_db/with_slashes"];
+  var r_db_name = get_random_db_name()
+  var dbNames = [r_db_name, r_db_name + "/with_slashes"];
   for (var i=0; i < dbNames.length; i++) {
     var db = new CouchDB(dbNames[i]);
     var dbName = encodeURIComponent(dbNames[i]);
-    db.deleteDb();
     db.createDb();
 
     // first just save a regular doc with an attachment that has a slash in the url.
@@ -149,5 +149,6 @@ couchTests.attachment_paths = function(debug) {
       "correct content-type"
     );
     T(binAttDoc._attachments["foo/bar2.txt"].length == 30);
+    db.deleteDb();
   }
 };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3715f376/test/javascript/tests/attachments_multipart.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/attachments_multipart.js b/test/javascript/tests/attachments_multipart.js
index abb8c4b..8e5bde9 100644
--- a/test/javascript/tests/attachments_multipart.js
+++ b/test/javascript/tests/attachments_multipart.js
@@ -419,5 +419,5 @@ couchTests.attachments_multipart= function(debug) {
 //  run_on_modified_server(server_config, testMultipartAttCompression);
 
 //  // cleanup
-//  db.deleteDb();
+  db.deleteDb();
 };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3715f376/test/javascript/tests/changes.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/changes.js b/test/javascript/tests/changes.js
index 8d13f19..10d7af3 100644
--- a/test/javascript/tests/changes.js
+++ b/test/javascript/tests/changes.js
@@ -150,6 +150,7 @@ couchTests.changes = function(debug) {
       // otherwise we'll continue to receive heartbeats forever
       xhr.abort();
     }
+    db.deleteDb();
   }
 
   if (!is_safari && xhr) {
@@ -278,10 +279,9 @@ couchTests.changes = function(debug) {
     T(change.id == "barzzzz");
     T(change.changes[0].rev == docBarz._rev);
     T(lines[3]=='"last_seq":5}');
-
-
   }
 
+  db.deleteDb();
   // test on a new DB
   var db_name = get_random_db_name();
   db = new CouchDB(db_name, {"X-Couch-Full-Commit":"true"});
@@ -590,6 +590,7 @@ couchTests.changes = function(debug) {
   });
 */
 
+  db.deleteDb();
   // COUCHDB-1037 - empty result for ?limit=1&filter=foo/bar in some cases
   // test w/ new temp DB
   db_name = get_random_db_name();
@@ -646,6 +647,7 @@ couchTests.changes = function(debug) {
 //  CouchDB.request("GET", "/" + db.name + "/_changes");
 //  TEquals(0, CouchDB.requestStats(['couchdb', 'httpd', 'clients_requesting_changes'], true).value);
 
+  db.deleteDb();
   // COUCHDB-1256
   // test w/ new temp DB
   db_name = get_random_db_name();
@@ -677,6 +679,7 @@ couchTests.changes = function(debug) {
   TEquals(1, resp.results.length);
   // TEquals(2, resp.results[0].changes.length);
 
+  db.deleteDb();
   // COUCHDB-1852
   // test w/ new temp DB
   db_name = get_random_db_name();
@@ -708,6 +711,7 @@ couchTests.changes = function(debug) {
   //T(changes[0][1] === "3");
   //T(changes[1][1] === "4");
 
+  db.deleteDb();
   // COUCHDB-1923
   // test w/ new temp DB
   db_name = get_random_db_name();
@@ -778,4 +782,5 @@ couchTests.changes = function(debug) {
   T(resp.results[0].doc._attachments['bar.txt'].encoding === "gzip");
   T(resp.results[0].doc._attachments['bar.txt'].encoded_length === 47);
 
+  db.deleteDb();
 };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3715f376/test/javascript/tests/conflicts.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/conflicts.js b/test/javascript/tests/conflicts.js
index c6c29c8..81b3d8d 100644
--- a/test/javascript/tests/conflicts.js
+++ b/test/javascript/tests/conflicts.js
@@ -117,4 +117,5 @@ couchTests.conflicts = function(debug) {
     db.open("doc", {"revs": true}));
   TEquals([], db.bulkSave([r4, r3, r2], {"new_edits":false}), "no failures");
 
+  db.deleteDb();
 };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3715f376/test/javascript/tests/design_options.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/design_options.js b/test/javascript/tests/design_options.js
index 9e602dc..cc2571f 100644
--- a/test/javascript/tests/design_options.js
+++ b/test/javascript/tests/design_options.js
@@ -73,4 +73,5 @@ couchTests.design_options = function(debug) {
   T(!!rows[1].key)
   var doc = db.open(resp.id);
   db.deleteDoc(doc);
+  db.deleteDb();
 };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3715f376/test/javascript/tests/design_paths.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/design_paths.js b/test/javascript/tests/design_paths.js
index 426a252..6e81699 100644
--- a/test/javascript/tests/design_paths.js
+++ b/test/javascript/tests/design_paths.js
@@ -12,11 +12,11 @@
 
 couchTests.design_paths = function(debug) {
   if (debug) debugger;
-  var dbNames = ["test_suite_db", "test_suite_db/with_slashes"];
+  var db_name = get_random_db_name()
+  var dbNames = [db_name, db_name + "/with_slashes"];
   for (var i=0; i < dbNames.length; i++) {
     var db = new CouchDB(dbNames[i]);
     var dbName = encodeURIComponent(dbNames[i]);
-    db.deleteDb();
     db.createDb();
 
     // create a ddoc w bulk_docs
@@ -68,5 +68,6 @@ couchTests.design_paths = function(debug) {
     // ensure that views are addressable
     resp = db.view("test2/testing");
     T(resp.total_rows == 0);
+    db.deleteDb();
   };
 };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3715f376/test/javascript/tests/replication.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/replication.js b/test/javascript/tests/replication.js
index 13a59bf..1a26889 100644
--- a/test/javascript/tests/replication.js
+++ b/test/javascript/tests/replication.js
@@ -1871,4 +1871,5 @@ couchTests.replication = function(debug) {
   //usersDb.deleteDb();
   sourceDb.deleteDb();
   targetDb.deleteDb();
+  (new CouchDB("test_suite_db")).deleteDb();
 };


Mime
View raw message