You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Jan Lehnardt <ja...@apache.org> on 2015/12/12 15:39:27 UTC

[2.0] The JavaScript test suite

Heya,

thanks all for chipping in with getting the JS test suite into shape!

I think we have a handle on it now, although there are few more curiosities that it’d be nice to get some light on from the cluster experts here.

All of these are run on a -n 1 cluster.


1. reduce.js: Error: expected '121', got ‘127'


  db_name = get_random_db_name();
  db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
  db.createDb();

  for(var i=1; i <= 5; i++) {

    for(var j=0; j < 10; j++) {
      // these docs are in the order of the keys collation, for clarity
      var docs = [];
      docs.push({keys:["a"]});
      docs.push({keys:["a"]});
      docs.push({keys:["a", "b"]});
      docs.push({keys:["a", "b"]});
      docs.push({keys:["a", "b", "c"]});
      docs.push({keys:["a", "b", "d"]});
      docs.push({keys:["a", "c", "d"]});
      docs.push({keys:["d"]});
      docs.push({keys:["d", "a"]});
      docs.push({keys:["d", "b"]});
      docs.push({keys:["d", "c"]});
      db.bulkSave(docs);
      var total_docs = ((i - 1) * 10 * 11) + ((j + 1) * 11);
      TEquals(total_docs, db.info().doc_count, "doc count should match");
    }
    ...
  }

The error messages comes from the TEquals() line. Why would there be a mismatch in written docs vs expected docs?


2. reduce_builtin.js: Error: expected '121', got ‘133'

This looks rather similar:

  db.deleteDb();
  db_name = get_random_db_name();
  db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
  db.createDb();

  for(var i=1; i <= 5; i++) {

    for(var j=0; j < 10; j++) {
      // these docs are in the order of the keys collation, for clarity
      var docs = [];
      docs.push({keys:["a"]});
      docs.push({keys:["a"]});
      docs.push({keys:["a", "b"]});
      docs.push({keys:["a", "b"]});
      docs.push({keys:["a", "b", "c"]});
      docs.push({keys:["a", "b", "d"]});
      docs.push({keys:["a", "c", "d"]});
      docs.push({keys:["d"]});
      docs.push({keys:["d", "a"]});
      docs.push({keys:["d", "b"]});
      docs.push({keys:["d", "c"]});
      db.bulkSave(docs);
      var total_docs = ((i - 1) * 10 * 11) + ((j + 1) * 11);
      TEquals(total_docs, db.info().doc_count, 'doc count should match');
    }
  ...
  }


3. replication.js: Updates to security docs are disabled during security migration

  TEquals(true, targetDb.setSecObj({
    admins: {
      names: ["superman"],
      roles: ["god"]
    }
  }).ok);

I don’t know what a security migration is, and what to do, when that happens.


Any light you can shed on any of these, that’d be fantastic!


* * *

I also sent this fix to chttpd https://github.com/apache/couchdb-chttpd/pull/98 that clearly shows we have dropped things from 1.x to 2.x that we we didn’t intend to. This is precisely why I’d like to get as many tests as possible passing here. (see my next email for more one this).


* * *

Current stats
  85 TOTAL
  40 PASS
  42 TODO
   3 FAIL

We are just under half way done.


Best
Jan
--