QA/Mozmill Test Automation/Dashboard/FAQ

From MozillaWiki
Jump to navigation Jump to search

Publishing

Which tools are necessary to push a Sammy application to a couchdb database?

To be able to push a Sammy application to a Couchdb instance, the following tools have to be installed:

  1. Node.js (Follow the instructions)
  2. Node package manager (Follow the instructions)
  3. node-couchapp (Execute the following command in the project folder)
$ npm install couchapp

How do I push a Sammy application to a Couchdb?

Pushing a Sammy application to a Couchdb database can be done in one step. To know which command line options are supported run the following snippet:

$ couchapp help
-d,  --design :: File or directory for design document(s)
-t,  --test :: Run tests.
-s,  --sync :: Sync with CouchDB.
-c,  --couch :: Url to couchdb.

The two options which are important are --design, and --couch. That means, uploading the design document with the name "dashboard.js" to the Couchdb database "mozmill" on localhost needs:

$ couchapp --design dashboard.js --couch http://localhost:5984/mozmill/

If the database has been protected by an admin and login credentials are necessary to push a design document, use the "user:password@" prefix in-front of the hostname.

Can node.couchapp automatically sync results with a database?

Yes, that is possible. Simply add the "--sync" option when pushing a design document to the database. The application will not exit, but each change to the design document will be detected and synced immediately. There is no need to run this command multiple times. The only execption is when couchdb views have to be updated. In such a case the application has to be restarted.