7543675e37
Bug 1191403 - Add a User Agent to requests made to Treeherder |
||
---|---|---|
bin | ||
factory | ||
test | ||
.gitignore | ||
.travis.yml | ||
Gruntfile.js | ||
README.md | ||
consts.js | ||
github.js | ||
github_test.js | ||
httperror.js | ||
httperror_test.js | ||
jsdoc.json | ||
package.json | ||
project.js | ||
project_test.js |
README.md
mozilla-treeherder
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.