Skip to content

Commit

Permalink
citgm: add version to output
Browse files Browse the repository at this point in the history
  • Loading branch information
Myles Borins committed Dec 17, 2015
1 parent 0a79e46 commit a038403
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bin/citgm
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ function launch(mod, options) {
}).on('end', function(module) {
if (module.error) {
process.exitCode = 1;
log.error('done', 'The test suite for ' + module.name + ' failed');
log.error('done', 'The test suite for ' + module.name + ' version ' + module.version + ' failed');
process.exit();
}
log.info('done', 'The test suite for ' + module.name + ' passed.');
log.info('done', 'The test suite for ' + module.name + ' version ' + module.version + ' passed.');
}).run();
}
11 changes: 8 additions & 3 deletions bin/citgm-all
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var app = require('commander');
var async = require('async');
var _ = require('lodash');
var chalk = require('chalk');

var update = require('../lib/update');
var citgm = require('../lib/citgm');
Expand Down Expand Up @@ -101,7 +102,7 @@ function runCitgm (mod, name, next) {
log[type](key, message);
}).on('end', function(module) {
if (module.error) {
log.error('done', 'The test suite for ' + module.name + ' failed');
log.error('done', 'The test suite for ' + module.name + ' version ' + module.version + ' failed');
if (mod.flakey) {
flakey.push(module);
}
Expand All @@ -112,14 +113,15 @@ function runCitgm (mod, name, next) {
}
else {
passed.push(module);
log.info('done', 'The test suite for ' + module.name + ' passed.');
log.info('done', 'The test suite for ' + module.name + ' version ' + module.version + ' passed.');
}
next();
}).run();
}

function printModule(logType, module) {
log[logType]('module name', module.name);
log[logType](chalk.yellow('module name:'), module.name);
log[logType](chalk.yellow('version:'), module.version);
if (module.error) {
log[logType]('error', module.error.message);
}
Expand All @@ -132,16 +134,19 @@ function printModules(logType, modules) {
}

function printModulesMarkdown(title, modules) {
/*eslint-disable no-console*/
if (modules.length > 0) {
console.log('##' + title + ' Modules');
_.each(modules, function (module) {
console.log('* ' + module.name);
console.log(' * version ' + module.version);
if (module.error) {
console.log(' * ' + module.error.message);
}
});
console.log('');
}
/*eslint-enable no-console*/
}

function launch() {
Expand Down
3 changes: 2 additions & 1 deletion lib/citgm.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ Tester.prototype.run = function() {
], function(err) {
if (!cleanexit) {
var payload = {
name: self.module.name || self.module.raw
name: self.module.name || self.module.raw,
version: self.module.version
};
if (err) {
self.emit('fail', err);
Expand Down
1 change: 1 addition & 0 deletions lib/lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function resolve(context, next) {
var meta = context.meta;
if (meta) {
var rep = lookup[detail.name];
context.module.version = meta.version;
if (rep) {
if (rep.replace) {
if (!rep.repo && !meta.repository) {
Expand Down

0 comments on commit a038403

Please sign in to comment.