couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowalski <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: tests: run setup in parallel
Date Tue, 19 May 2015 20:20:30 GMT
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/423#discussion_r30641948
  
    --- Diff: test/nightwatch_tests/helpers/helpers.js ---
    @@ -25,23 +26,31 @@ module.exports = {
     
         console.log("nano setting up database");
         // clean up the database we created previously
    -    nano.db.destroy(database, function (err, body, header) {
    -      if (err) {
    -        if (err.message != 'Database does not exist.' && err.message != 'missing')
{
    -          console.log('Error in setting up ' + database, err.message);
    -        }
    -      }
    -      // create a new database
    -      nano.db.create(database, function (err, body, header) {
    -        if (err) {
    -          console.log('Error in setting up ' + database, err.message);
    -        }
    +    async.parallel([
    +      function (cb) {
    +        nano.db.destroy(database, function (err, body, header) {
    +          if (err && err.message !== 'Database does not exist.' && err.message
!== 'missing') {
    +            console.log('Error in setting up ' + database, err.message);
    +          }
    +          // create a new database
    +          nano.db.create(database, function (err, body, header) {
    +            if (err) {
    +              console.log('Error in setting up ' + database, err.message);
    +            }
    +            cb();
    +          });
    +        });
    +      },
    +      function (cb) {
             nano.db.create('_replicator', function (err, body, header) {
    --- End diff --
    
    it creates the replicator db in parallel to the fauxton-seleniumtest db, shaving off a
few second each time (https://github.com/caolan/async#parallel) instead of running them chained
in a synchronously manner


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message