RipcordSoftware / AvanceDB

An in-memory database based on the CouchDB REST API and containing the CouchDB Futon and Fauxton web sites
GNU Affero General Public License v3.0
161 stars 12 forks source link

Pass the PouchDB test suite #59

Open nolanlawson opened 8 years ago

nolanlawson commented 8 years ago

Cool project! :smiley: Thought I would give you some pointers about how to run and pass the PouchDB test suite, since it's a pretty good way to determine whether or not you fully implement the CouchDB API. (For the record, Cloudant and PouchDB Server are passing, and Couchbase Sync Gateway passes most of it. Not sure about rsync or Drupal Relaxed Web Services.)

To run the test suite:

git clone https://github.com/pouchdb/pouchdb.git
cd pouchdb
npm install
BAIL=0 COUCH_HOST=http://127.0.0.1:5994 npm test

(BAIL=0 tells the test suite not to bail at the first test, which is good for debugging.)

First thing that's not passing: you need to enable HEAD requests against /. Otherwise the PouchDB tests will not even start, because they think the server is down. (You'll see: Waiting for host to start ..... Host failed to start.

Second thing that's not passing: _all_docs is not passing all tests; see test output for details. Seems related to key/keys/include_docs. Note that keys has different behavior for the other options; you need to include the deleted docs in order for it to pass.

Third thing that's not passing: attachments. See test.attachments.js tests for details. PouchDB doesn't do multipart, so you just need to support base64 with application/json.

Fourth thing: _bulk_docs with new_edits=false. This is basically required for replication to function correctly, but it's kind of tricky.

Fifth thing: _changes - not implemented yet?

There are some other failures, but the steps above should give you a good starting point. The tests are all located in tests/integration, and you can also follow our testing instructions in TESTING.md to run them one at a time. Let me know or cc @daleharvey if you need any guidance!

craigminihan commented 8 years ago

@nolanlawson thanks for taking the time to check out Avance. You already have a good handle on CouchDB bits it doesn't do. I'm backfilling these as I get time.

I just added a HEAD / and will check out the _all_docs and _bulk_docs issues which seem to fail.

I've not implemented any of _changes or attachments yet - so it wasn't a surprise to see the tests all go red.

TBH I'm glad it didn't segfault!