added test runner for jenkins

This commit is contained in:
Spencer Alger
2013-11-11 13:10:30 -07:00
parent 0fa5da3f62
commit 7912ae63af
18 changed files with 15249 additions and 3393 deletions

View File

@ -9,23 +9,32 @@ var urlParamRE = /\{(\w+)\}/g;
var outputPath = _.joinPath(__dirname, '../../../src/lib/api.js');
require('./actions').on('ready', function (actions) {
var defs = [];
function download() {
require('./actions').on('ready', function (actions) {
var defs = [];
var namespaces = _.filter(_.map(actions, function (action) {
if (~action.location.indexOf('.')) {
var path = action.location.split('.').slice(0, -1);
_.pull(path, 'prototype');
return path.join('.');
}
}));
clean(outputPath);
console.log('writing', actions.length, 'api actions to', outputPath);
fs.writeFileSync(outputPath, templates.apiFile({
actions: actions,
namespaces: _.unique(namespaces.sort(), true)
}));
});
var namespaces = _.filter(_.map(actions, function (action) {
if (~action.location.indexOf('.')) {
var path = action.location.split('.').slice(0, -1);
_.pull(path, 'prototype');
return path.join('.');
}
}));
clean(outputPath);
console.log('writing', actions.length, 'api actions to', outputPath);
fs.writeFileSync(outputPath, templates.apiFile({
actions: actions,
namespaces: _.unique(namespaces.sort(), true)
}));
});
}
try {
var stat = fs.statSync(outputPath);
if (!stat.isFile() || stat.ctime < Date.now() - 86400000) {
download();
}
} catch (e) {
download();
}