*DEPRECATED* NodeJS interface for Treeherder
Перейти к файлу
Ed Morley 66cfc36f2b Bump version to 0.7.0 2016-02-15 20:28:56 +00:00
bin Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-18 13:14:12 -05:00
factory Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-18 13:14:12 -05:00
test Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-18 13:14:12 -05:00
.gitignore ignore /doc 2014-02-26 02:41:07 -08:00
.travis.yml Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-18 13:14:12 -05:00
Gruntfile.js Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-18 13:14:12 -05:00
README.md README: Use canonical Treeherder repo URL and remove traceback example 2016-02-15 18:49:41 +00:00
consts.js Bug 1191403 - Add a User Agent to requests made to Treeherder 2016-02-15 18:55:30 +00:00
github.js Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-18 13:14:12 -05:00
github_test.js Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-18 13:14:12 -05:00
httperror.js Merge branch 'master' of github.com:lightsofapollo/treeherder-node 2015-01-23 11:45:52 -08:00
httperror_test.js Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-18 13:14:12 -05:00
jsdoc.json fix source links 2014-02-26 18:40:08 -08:00
package.json Bump version to 0.7.0 2016-02-15 20:28:56 +00:00
project.js Bug 1191403 - Add a User Agent to requests made to Treeherder 2016-02-15 18:55:30 +00:00
project_test.js Update client to use hawk credentails instead of oauth 2015-11-03 15:55:38 -06:00

README.md

mozilla-treeherder Build Status

NodeJS interface for treeherder.

Usage

var Project = require('mozilla-treeherder/project');

// this configuration can be acquired from an ateam member working on
// treeherder (mdoglio).
var project = new Project('gaia', {
  clientId: '...',
  secret: '',
  // Disabled by default but will retry post / put requests if a 429 is
  // returned.
  throttleRetries: 2
});

CLI

See all the options with:

./bin/treeherder --help

Reporting Treeherder bugs

treeherder api errors will include a traceback from the server. Most times these errors are simply something you did wrong (no hawk credentials, wrong parameters, etc...) but there are times when there are actually bugs in treeherder... Submit an issue with the traceback.

Tests

(you must run npm install first)

// run all the tests
npm test

// run one test
./node_modules/.bin/mocha path_to_test.js

Tests use nock so we can test some of our logic on CI without hitting real servers but they are also designed to work with nock disabled... To test against real servers do this:

// XXX: Testing this way is potentially buggy use at your own risk...
NOCK_OFF=true ./node_modules/.bin/mocha path_to_test

Notes

  • TREEHERDER_URL environment variable can be used to configure the base url for treeherder.