Skip to content

Commit

Permalink
build timeCompleted is now sent view socket.
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalpandya committed Nov 29, 2015
1 parent 38ff62c commit ae9d571
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions services/changelistmonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ changelistMonitor = function(sivartApp) {
if (changelists &&
changelists.length)
{
io.emit('buildstart', changelistId);

io.emit('buildstart', changelistId, (new Date()).getTime());

changelists.forEach(function(changelistItem) {
buildItemCount++;
Expand All @@ -38,7 +39,11 @@ changelistMonitor = function(sivartApp) {
var utItemCount = 0;

changelistItem.build.timeCompleted = (new Date()).getTime();
io.emit('buildfinished', changelistId, buildItemCount === 2 ? -1 : 1);
io.emit('buildfinished',
changelistId,
buildItemCount === 2 ? -1 : 1,
changelistItem.build.timeCompleted
);

if (buildItemCount !== 2)
{
Expand All @@ -48,15 +53,29 @@ changelistMonitor = function(sivartApp) {
var ftItemCount = 0;

changelistItem.build.timeCompleted = (new Date()).getTime();
io.emit('unittestfinished', changelistId, buildItemCount === 3 ? -1 : 1);
changelistItem.unitTest.passCount = 276;
changelistItem.unitTest.duration = changelistItem.build.timeCompleted - changelistItem.timeStarted;
io.emit('unittestfinished',
changelistId,
buildItemCount === 3 ? -1 : 1,
changelistItem.build.timeCompleted,
changelistItem.unitTest.passCount
);

if (buildItemCount !== 3)
{
io.emit('functionalteststart', changelistId);
ftItemCount++;
setTimeout(function(changelistId, utItemCount) {
changelistItem.build.timeCompleted = (new Date()).getTime();
io.emit('functionaltestfinished', changelistId, buildItemCount === 4 ? -1 : 1);
changelistItem.functionalTest.passCount = 13375;
changelistItem.functionalTest.duration = changelistItem.build.timeCompleted - changelistItem.timeStarted;
io.emit('functionaltestfinished',
changelistId,
buildItemCount === 4 ? -1 : 1,
changelistItem.build.timeCompleted,
changelistItem.functionalTest.passCount
);
}, ftItemCount * 5000, changelistId, buildItemCount);
}
}, utItemCount * 5000, changelistId, buildItemCount);
Expand Down

0 comments on commit ae9d571

Please sign in to comment.