diff options
author | Joan Touzet <joant@atypical.net> | 2017-07-07 03:20:01 -0400 |
---|---|---|
committer | Joan Touzet <wohali@users.noreply.github.com> | 2017-07-07 12:38:13 -0400 |
commit | 7885d80db6dbf4668c1b5b00c334de2942767dd4 (patch) | |
tree | da5ad7831de2e97497178a87e52ae5d10499bb08 | |
parent | a461c44a33c2a0d505a57ca4fe916f69fbd116db (diff) | |
download | couchdb-7885d80db6dbf4668c1b5b00c334de2942767dd4.tar.gz |
wipe all databases on test exit
-rw-r--r-- | test/javascript/tests/config.js | 3 | ||||
-rw-r--r-- | test/javascript/tests/delayed_commits.js | 6 | ||||
-rw-r--r-- | test/javascript/tests/proxyauth.js | 2 | ||||
-rw-r--r-- | test/javascript/tests/reader_acl.js | 7 | ||||
-rw-r--r-- | test/javascript/tests/replication.js | 3 | ||||
-rw-r--r-- | test/javascript/tests/rev_stemming.js | 2 | ||||
-rw-r--r-- | test/javascript/tests/rewrite.js | 5 | ||||
-rw-r--r-- | test/javascript/tests/rewrite_js.js | 3 | ||||
-rw-r--r-- | test/javascript/tests/security_validation.js | 5 |
9 files changed, 26 insertions, 10 deletions
diff --git a/test/javascript/tests/config.js b/test/javascript/tests/config.js index bb3b86e8a..ee51ef5b9 100644 --- a/test/javascript/tests/config.js +++ b/test/javascript/tests/config.js @@ -11,9 +11,6 @@ // the License. couchTests.config = function(debug) { - var db_name = get_random_db_name(); - var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); - db.createDb(); if (debug) debugger; // test that /_config returns all the settings diff --git a/test/javascript/tests/delayed_commits.js b/test/javascript/tests/delayed_commits.js index 1fda84b18..cfb59d11e 100644 --- a/test/javascript/tests/delayed_commits.js +++ b/test/javascript/tests/delayed_commits.js @@ -32,6 +32,9 @@ couchTests.delayed_commits = function(debug) { // other updates. If it crashes or is restarted you may lose the most // recent commits. + // restartServer() requires a server to be up 15s before it restarts + sleep(15000); + T(db.save({_id:"1",a:2,b:4}).ok); T(db.open("1") != null); @@ -41,4 +44,7 @@ couchTests.delayed_commits = function(debug) { // note if we waited > 1 sec before the restart, the doc would likely // commit. }); + + // cleanup + db.deleteDb(); }; diff --git a/test/javascript/tests/proxyauth.js b/test/javascript/tests/proxyauth.js index 1c5ffc888..c60c24e46 100644 --- a/test/javascript/tests/proxyauth.js +++ b/test/javascript/tests/proxyauth.js @@ -132,4 +132,6 @@ couchTests.proxyauth = function(debug) { // cleanup db.deleteDb(); + usersDb.deleteDb(); + }; diff --git a/test/javascript/tests/reader_acl.js b/test/javascript/tests/reader_acl.js index df390cad4..a43b4d1df 100644 --- a/test/javascript/tests/reader_acl.js +++ b/test/javascript/tests/reader_acl.js @@ -214,7 +214,12 @@ couchTests.reader_acl = function(debug) { testFun // stick to the essentials and do it all in one ); - // cleanup usersDb.deleteDb(); + // have to delete the backside version now too :( + var req = CouchDB.newXhr(); + req.open("DELETE", "http://127.0.0.1:15986/" + users_db_name, false); + req.send(""); + CouchDB.maybeThrowError(req); + secretDb.deleteDb(); } diff --git a/test/javascript/tests/replication.js b/test/javascript/tests/replication.js index b51a7084a..c7861b342 100644 --- a/test/javascript/tests/replication.js +++ b/test/javascript/tests/replication.js @@ -1715,9 +1715,6 @@ couchTests.replication = function(debug) { // COUCHDB-885 - push replication of a doc with attachment causes a // conflict in the target. - sourceDb = new CouchDB("test_suite_db_a"); - targetDb = new CouchDB("test_suite_db_b"); - populateSourceDb([]); populateTargetDb([]); diff --git a/test/javascript/tests/rev_stemming.js b/test/javascript/tests/rev_stemming.js index 5a67685f5..238868f60 100644 --- a/test/javascript/tests/rev_stemming.js +++ b/test/javascript/tests/rev_stemming.js @@ -117,5 +117,7 @@ couchTests.rev_stemming = function(debug) { "should return a truncated revision list"); // cleanup + db_orig.deleteDb(); db.deleteDb(); + dbB.deleteDb(); }; diff --git a/test/javascript/tests/rewrite.js b/test/javascript/tests/rewrite.js index 9e0e03ac3..8ff32295b 100644 --- a/test/javascript/tests/rewrite.js +++ b/test/javascript/tests/rewrite.js @@ -505,8 +505,7 @@ couchTests.rewrite = function(debug) { TEquals(200, xhr.status); } }); + // cleanup + db.deleteDb(); } - - // cleanup - db.deleteDb(); } diff --git a/test/javascript/tests/rewrite_js.js b/test/javascript/tests/rewrite_js.js index 9aecd61d3..9893127af 100644 --- a/test/javascript/tests/rewrite_js.js +++ b/test/javascript/tests/rewrite_js.js @@ -336,5 +336,8 @@ couchTests.rewrite = function(debug) { var url = "/"+dbName+"/_design/loop/_rewrite/loop"; var xhr = CouchDB.request("GET", url); TEquals(400, xhr.status); + + // cleanup + db.deleteDb(); } } diff --git a/test/javascript/tests/security_validation.js b/test/javascript/tests/security_validation.js index 0bd90975c..e0b000fd5 100644 --- a/test/javascript/tests/security_validation.js +++ b/test/javascript/tests/security_validation.js @@ -325,4 +325,9 @@ couchTests.security_validation = function(debug) { adminDbB.deleteDb(); } authDb.deleteDb(); + // have to clean up authDb on the backside :( + var req = CouchDB.newXhr(); + req.open("DELETE", "http://127.0.0.1:15986/" + authDb_name, false); + req.send(""); + CouchDB.maybeThrowError(req); }; |