Skip to content

Commit

Permalink
typo summery -> summary
Browse files Browse the repository at this point in the history
moved check and x marks
  • Loading branch information
zurawiki committed May 11, 2014
1 parent 60d3eb6 commit 8d7192c
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion lib/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ Session.prototype._doSpawn = function(command, options, callback) {
sendCallback(new Error('TIMEOUT'));
exec('sh ' + killScript + ' ' + bash.pid, function(err) {
if(err) {
console.error('kiiling on timeout failed');
console.error('Killing on timeout failed');
}
});
timeoutHandler = null;
Expand Down
12 changes: 6 additions & 6 deletions lib/taskList.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ TaskList.prototype.run = function(sessions, options, callback) {
options = {};
}
options = options || {};
var summeryMap = {};
var summaryMap = {};
var completed = 0;

self.log('info', '\nStarted TaskList: ' + this._name);
Array.prototype.forEach.call(sessions, function(session) {
self._runTaskQueue(session, function(err, history) {
summeryMap[session._host] = {error: err, history: history};
summaryMap[session._host] = {error: err, history: history};

if(++completed == sessions.length) {
self.log('info', 'Completed TaskList: ' + self._name);
if(callback) callback(summeryMap);
if(callback) callback(summaryMap);
}
});
});
Expand Down Expand Up @@ -85,7 +85,7 @@ TaskList.prototype._runTaskQueue = function(session, callback) {
var task = self._taskQueue[cnt++];
if(task) {
self.emit('started', task.id);
self.log('log', util.format('[%s]'.magenta+' %s', session._host, task.id));
self.log('log', util.format('[%s] '.magenta+'. %s', session._host, task.id));
var options = self._evaluateOptions(task.options, session);
TaskList._registeredTasks[task.type](session, options, function(err) {
if(err) {
Expand All @@ -95,7 +95,7 @@ TaskList.prototype._runTaskQueue = function(session, callback) {
error: err.message
});
self.emit('failed', err, task.id);
self.log('error', util.format('[%s]'.magenta+' %s: FAILED \u2718 \n\t%s'.red, session._host, task.id, err.message.replace(/\n/g, '\n\t')));
self.log('error', util.format('[%s] '.magenta+'\u2718 %s: FAILED\n\t%s'.red, session._host, task.id, err.message.replace(/\n/g, '\n\t')));

if(self._ignoreErrors) {
runTask();
Expand All @@ -107,7 +107,7 @@ TaskList.prototype._runTaskQueue = function(session, callback) {
task: task.id,
status: 'SUCCESS'
})
self.log('log', util.format('[%s]'.magenta+' %s: SUCCESS \u2714'.green, session._host, task.id));
self.log('log', util.format('[%s] '.magenta+'\u2714 %s: SUCCESS'.green, session._host, task.id));
self.emit('success', task.id);
runTask();
}
Expand Down
28 changes: 14 additions & 14 deletions lib/taskListsRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function TaskListRunner(options) {
TaskListRunner.prototype.add = function(taskList, sessions) {
var self = this;
if(!sessions) {
throw new Error('no session provided');
throw new Error('No session provided');
} else if(!sessions instanceof Array) {
sessions = [sessions]
}
Expand Down Expand Up @@ -43,10 +43,10 @@ TaskListRunner.prototype.run = function(options) {
function runTaskList() {
var item = self._items[count++];
if(item) {
item.taskList.run(item.sessions, options, function(summeryMap) {
var erroredSummeryMap = self._pickErrored(summeryMap);
if(erroredSummeryMap) {
self._printErroredSummeryMap(erroredSummeryMap);
item.taskList.run(item.sessions, options, function(summaryMap) {
var erroredSummaryMap = self._pickErrored(summaryMap);
if(erroredSummaryMap) {
self._printErroredSummaryMap(erroredSummaryMap);
} else {
runTaskList();
}
Expand All @@ -55,27 +55,27 @@ TaskListRunner.prototype.run = function(options) {
}
};

TaskListRunner.prototype._pickErrored = function(summeryMap) {
var erroredSummeryMap = {};
TaskListRunner.prototype._pickErrored = function(summaryMap) {
var erroredSummaryMap = {};
var errorFound = false;

for(var host in summeryMap) {
if(summeryMap[host].error) {
erroredSummeryMap[host] = summeryMap[host];
for(var host in summaryMap) {
if(summaryMap[host].error) {
erroredSummaryMap[host] = summaryMap[host];
errorFound = true;
}
}

if(errorFound) {
return erroredSummeryMap;
return erroredSummaryMap;
} else {
return null;
}
};

TaskListRunner.prototype._printErroredSummeryMap = function(summeryMap) {
var hosts = Object.keys(summeryMap);
var message = ">> ERROR(S) in: " + hosts.join(', ');
TaskListRunner.prototype._printErroredSummaryMap = function(summaryMap) {
var hosts = Object.keys(summaryMap);
var message = "\u2718 ERROR(S) in: " + hosts.join(', ');
console.error(message.bold.red);
};

Expand Down
46 changes: 23 additions & 23 deletions test/taskList.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ suite('TaskList', function() {
var taskList = new TaskList('simple', {pretty: false});
taskList.simpleTask('Simple Name', {aa: 10});
taskList.simpleTask('Simple Name2', {aa: 20});
taskList.run(session, function(summeryMap) {
assert.deepEqual(summeryMap[session._host], {error: null, history: [
taskList.run(session, function(summaryMap) {
assert.deepEqual(summaryMap[session._host], {error: null, history: [
{task: 'Simple Name', status: 'SUCCESS'},
{task: 'Simple Name2', status: 'SUCCESS'}
]});
Expand All @@ -40,10 +40,10 @@ suite('TaskList', function() {
taskList.simpleTask2('one', {aa: 10});
taskList.simpleTask2('two', {aa: 20});
taskList.simpleTask2('three', {aa: 30});
taskList.run(session, function(summeryMap) {
var summery = summeryMap[session._host];
assert.equal(summery.error.message, 'error-here');
assert.deepEqual(summery.history, [
taskList.run(session, function(summaryMap) {
var summary = summaryMap[session._host];
assert.equal(summary.error.message, 'error-here');
assert.deepEqual(summary.history, [
{task: 'one', status: 'SUCCESS'},
{task: 'two', status: 'FAILED', error: 'error-here'}
]);
Expand All @@ -66,13 +66,13 @@ suite('TaskList', function() {
taskList.simpleTask3('one', {aa: 10});
taskList.simpleTask3('two', {aa: 20});
taskList.simpleTask3('three', {aa: 30});
taskList.run(session, function(summeryMap) {
var summery = summeryMap[session._host];
assert.ifError(summery.error);
assert.deepEqual(summery.history, [
taskList.run(session, function(summaryMap) {
var summary = summaryMap[session._host];
assert.ifError(summary.error);
assert.deepEqual(summary.history, [
{task: 'one', status: 'SUCCESS'},
{task: 'two', status: 'FAILED', error: 'error-here'},
{task: 'three', status: 'SUCCESS'},
{task: 'three', status: 'SUCCESS'}
]);
done();
});
Expand Down Expand Up @@ -102,8 +102,8 @@ suite('TaskList', function() {
var combined = tl1.concat([tl2, tl3]);
assert.equal(combined._name, tl1._name + '+');

combined.run(session, function(summeryMap) {
assert.ifError(summeryMap[session._host].error);
combined.run(session, function(summaryMap) {
assert.ifError(summaryMap[session._host].error);
assert.deepEqual(optionsList, [
{aa: 10}, {aa: 20}, {aa: 30}, {aa: 40}, {aa: 50}, {aa: 60}
]);
Expand Down Expand Up @@ -142,8 +142,8 @@ suite('TaskList', function() {
aa: 20
});

taskList.run(session, function(summeryMap) {
assert.deepEqual(summeryMap[session._host], {error: null, history: [
taskList.run(session, function(summaryMap) {
assert.deepEqual(summaryMap[session._host], {error: null, history: [
{task: 'One', status: 'SUCCESS'},
{task: 'Two', status: 'SUCCESS'}
]});
Expand Down Expand Up @@ -191,13 +191,13 @@ suite('TaskList', function() {
aa: 20
});

taskList.run(sessions, function(summeryMap) {
assert.deepEqual(summeryMap['a'], {error: null, history: [
taskList.run(sessions, function(summaryMap) {
assert.deepEqual(summaryMap['a'], {error: null, history: [
{task: 'One', status: 'SUCCESS'},
{task: 'Two', status: 'SUCCESS'}
]});

assert.deepEqual(summeryMap['b'], {error: null, history: [
assert.deepEqual(summaryMap['b'], {error: null, history: [
{task: 'One', status: 'SUCCESS'},
{task: 'Two', status: 'SUCCESS'}
]});
Expand Down Expand Up @@ -244,13 +244,13 @@ suite('TaskList', function() {
aa: 20
});

taskList.run(sessions, function(summeryMap) {
assert.deepEqual(summeryMap['a'], {error: null, history: [
taskList.run(sessions, function(summaryMap) {
assert.deepEqual(summaryMap['a'], {error: null, history: [
{task: 'One', status: 'SUCCESS'},
{task: 'Two', status: 'SUCCESS'}
]});

assert.deepEqual(summeryMap['b'], {error: null, history: [
assert.deepEqual(summaryMap['b'], {error: null, history: [
{task: 'One', status: 'SUCCESS'},
{task: 'Two', status: 'SUCCESS'}
]});
Expand Down Expand Up @@ -296,8 +296,8 @@ suite('TaskList', function() {
aa: 20
});

taskList.run(session, function(summeryMap) {
assert.deepEqual(summeryMap[session._host], {error: null, history: [
taskList.run(session, function(summaryMap) {
assert.deepEqual(summaryMap[session._host], {error: null, history: [
{task: 'One', status: 'SUCCESS'},
{task: 'Two', status: 'SUCCESS'}
]});
Expand Down

0 comments on commit 8d7192c

Please sign in to comment.