couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [1/7] fauxton commit: updated refs/heads/master to ced196a
Date Tue, 12 Jul 2016 17:25:16 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master c5fc7018a -> ced196ab1


make remove-test-dbs async


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

Branch: refs/heads/master
Commit: ced196ab123987e675145e36d021de13b257cdeb
Parents: e1e5947
Author: Garren Smith <garren.smith@gmail.com>
Authored: Tue Jul 12 16:46:12 2016 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Tue Jul 12 19:24:44 2016 +0200

----------------------------------------------------------------------
 bin/remove-test-dbs.js                   | 31 +++++++++++++++++----------
 test/nightwatch_tests/helpers/helpers.js |  2 +-
 2 files changed, 21 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/ced196ab/bin/remove-test-dbs.js
----------------------------------------------------------------------
diff --git a/bin/remove-test-dbs.js b/bin/remove-test-dbs.js
index 3b8fa88..7d85efd 100755
--- a/bin/remove-test-dbs.js
+++ b/bin/remove-test-dbs.js
@@ -1,6 +1,7 @@
 #!/usr/bin/env node
 
 const fs = require('fs');
+const async = require('async');
 
 const settingsFilePath = './settings.json';
 const settingsFile = fs.existsSync(settingsFilePath) ? settingsFilePath : './settings.json.default.json';
@@ -13,18 +14,26 @@ nano.db.list((err, body) => {
     console.log('ERR', err);
     return;
   }
-  const out = body.forEach(db => {
-    if (!/fauxton-selenium-tests/.test(db)) {
-      return;
-    }
+  const list = body.filter(db => {
+    return /fauxton-selenium-tests/.test(db);
+  }).map(db => {
+    return (cb) => {
+      console.log('removing', db);
+      nano.db.destroy(db, (err, resp) => {
+        if (err) {
+          cb(err);
+          return;
+        }
+
+        cb();
+      });
+    };
+  });
 
-    console.log('removing', db);
-    nano.db.destroy(db, (err, resp) => {
-      if (err) {
-        console.log('ERR deleting ', db, err);
-        return;
-      }
-    });
+  async.parallel(list, (err) => {
+    if (err) {
+      console.error(err);
+    }
   });
 
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/ced196ab/test/nightwatch_tests/helpers/helpers.js
----------------------------------------------------------------------
diff --git a/test/nightwatch_tests/helpers/helpers.js b/test/nightwatch_tests/helpers/helpers.js
index 137e19e..f0e4777 100644
--- a/test/nightwatch_tests/helpers/helpers.js
+++ b/test/nightwatch_tests/helpers/helpers.js
@@ -25,7 +25,7 @@ module.exports = {
   testDatabaseName : dbName,
 
   getNanoInstance: function (dbURL) {
-    console.log('bbb', dbURL);
+    console.log('DBURL:', dbURL);
     return nano(dbURL);
   },
 


Mime
View raw message