Created
May 14, 2012 17:27
-
-
Save Hounddog/2695194 to your computer and use it in GitHub Desktop.
Dojo Object Harness Continuous integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connect = require('connect'); | |
var app = connect() | |
// .use(connect.logger('dev')) | |
.use(connect.static('public')) | |
.use(function(req, res){ | |
var body = '404 page not found'; | |
res.statusCode = 404; | |
res.setHeader('Content-Length', body.length); | |
res.end(body); | |
}) | |
.listen(8080); | |
var io = require('socket.io').listen(app) | |
io.set('log level', 1); | |
io.sockets.on('connection', function (socket) { | |
socket.on('debug', function (message) { | |
console.log(message); | |
}); | |
socket.on('close', function(val){ | |
if(val) { | |
console.log('all tests completed successfully'); | |
} else { | |
console.log('tests failed'); | |
} | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install through npm | |
need to include | |
<script src="/socket.io/socket.io.js></script> into runner.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "DOH CL", | |
"version": "0.0.1", | |
"author": { | |
"name": "Martin Shwalbe", | |
"email": "[email protected]" | |
}, | |
"description": "DOH Commandline Integration fro browser runner", | |
"main": "", | |
"repository": { | |
"type": "git", | |
"url": "git://github.com/Hounddog/..." | |
}, | |
"keywords": [ | |
"nodeapps", | |
"dojo", | |
"doh" | |
], | |
"homepage": "", | |
"scripts": { | |
"start": "node ./bin/server.js" | |
}, | |
"dependencies": { | |
"socket.io": "=0.9.5" | |
}, | |
"devDependencies": { | |
"connect": "=2.1.2" | |
}, | |
"engines": { | |
"node": ">=0.6.15" | |
}, | |
"bugs": { | |
"url": "https://github.com/Hounddog/..." | |
}, | |
"licenses": [ | |
{ | |
"type": "MIT", | |
"url": "..." | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(["doh/runner"], function(doh) { | |
var origDebug = doh.debug; | |
var socket = io.connect(); | |
doh.debug = function() { | |
// var myArguments = arguments; | |
origDebug(arguments); | |
socket.emit('debug',Array.prototype.join.call(arguments, " ") ); | |
}; | |
var origReport = doh._report; | |
doh._report = function() { | |
origReport(); | |
if(this._failureCount >0) { | |
socket.emit('close', false); | |
} else { | |
socket.emit('close', true); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment