QA/Mozmill Test Automation/Dashboard/FAQ

From MozillaWiki
Jump to: navigation, search


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.

If you are on Ubuntu you can install node.js via the package manager:

$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs npm

On other systems you will have to follow the installation instructions:

  1. Node.js (Follow the instructions)
  2. Node package manager (Follow the instructions)

Additional steps:

  1. node-couchapp (Execute the following command in the project folder - this ensures that couchapp is available to JS code in requires() statements)
  2. $ npm install couchapp
  3. You also need to globally install couchapp so that you can use it on the command line:
  4. $ npm install -g couchapp

How do I setup an instance of the Dashboard?

To setup an instance of the dashboard you will have to create a vhost entry for Couchdb and setup an appropriate DNS entry for it. It's necessary because the rewrite feature is used.

Therefore open the Futon web interface (e.g. and login as administrator. Select the 'Configuration' entry and scroll to the bottom of the configuration page. Click on 'Add a new Section' and enter the requested information as given by the example below:

section:  vhosts
option:   %dbname%.%host%
value:    /%dbname%/_design/dashboard/_rewrite

If you are using localhost as %host% you can test it by adding an entry like ' %dbname%.localhost' to /etc/hosts. If you want to make it publicly available to everyone you should create a CNAME entry for your domain.

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 push dashboard.js 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.