Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

get rid of 'sys' package replaced with 'util'

phantomjs no longer needs an option on the command line
  • Loading branch information...
commit c452d36da851a64d6ffed5f9201c6f4914905225 1 parent 28e01cc
@zzo authored
View
6 backend/nodejute/jute/actions/prune.js
@@ -104,8 +104,8 @@ module.exports = {
}
function prune_browsers(req) {
- var me = req.session.uuid,
- sys = require('sys');
+ var me = req.session.uuid,
+ util = require('util');
// only check other browsers
for (browser in cache.browsers) {
@@ -122,7 +122,7 @@ module.exports = {
var test = cache.tests_to_run[i];
if (test.browser == browser) {
// blow this test out!
- hub.emit(hub.LOG, hub.ERROR, "Deleting this test that was part of lost browser: " + sys.inspect(test));
+ hub.emit(hub.LOG, hub.ERROR, "Deleting this test that was part of lost browser: " + util.inspect(test));
cache.tests_to_run.splice(i, 1);
i--; // fake a perl 'redo'!! Otherwise we might skip over something!
common.badUnitTest(req, test);
View
16 backend/nodejute/jute/actions/runTest.js
@@ -48,14 +48,14 @@ module.exports = {
path = require('path'),
fs = require('fs'),
obj = req.body,
- sys = require('sys'),
+ util = require('util'),
tests, multipleFromUI = false,
capture = false,
exec = require('child_process').exec,
errors = []
;
- hub.emit(hub.LOG, hub.INFO, 'OBJ: ' + sys.inspect(obj));
+ hub.emit(hub.LOG, hub.INFO, 'OBJ: ' + util.inspect(obj));
if (obj.test) {
multipleFromUI = true;
// 'run multiple' from UI
@@ -157,13 +157,9 @@ module.exports = {
cache.tests_to_run.push(test_obj);
pushed = true;
} else if (obj.phantomjs) {
- if (obj.phantomjs == 1) {
- obj.phantomjs = hub.config.phantomjs;
- if (!obj.screen) {
- obj.screen = hub.config.screen;
- }
+ if (!obj.screen) {
+ obj.screen = hub.config.screen;
}
- test_obj.phantomjs = obj.phantomjs;
if (obj.send_output) {
test_obj.sendOutput = 1;
}
@@ -215,7 +211,7 @@ module.exports = {
}
}
- common.addTestOutput(test_obj, sys.inspect(test_obj));
+ common.addTestOutput(test_obj, util.inspect(test_obj));
}
if (pushed) {
@@ -273,7 +269,7 @@ module.exports = {
});
seleniumIDs.forEach(function(selID) {
- hub.emit('action:phantomjsStart', selID, obj.phantomjs, obj.screen, req, res);
+ hub.emit('action:phantomjsStart', selID, obj.screen, req, res);
});
}else {
// UI wants to run multiple tests - redirect to it!
View
4 backend/nodejute/jute/actions/startPhantomjs.js
@@ -38,7 +38,6 @@ module.exports = {
Create: function(hub, common) {
// Javascript is single threaded! We don't have to worry about concurrency!
var path = require('path'),
- sys = require('sys'),
fs = require('fs'),
child = require('child_process'),
cache = hub.cache
@@ -47,8 +46,9 @@ module.exports = {
// Events I care about
hub.addListener('action:phantomjsStart', startPhantomjs);
- function startPhantomjs(selID, phantomjs, screen, req, res) {
+ function startPhantomjs(selID, screen, req, res) {
var cb, phantom, body = req.body,
+ phantomjs = hub.config.phantomjs,
url = 'http://' + (hub.config.host ? hub.config.host + ':' + hub.config.port : req.headers.host) + '/?selenium=' + selID
;
View
1  backend/nodejute/jute/actions/startSelenium.js
@@ -38,7 +38,6 @@ module.exports = {
Create: function(hub) {
// Javascript is single threaded! We don't have to worry about concurrency!
var path = require('path'),
- sys = require('sys'),
fs = require('fs'),
cache = hub.cache
;
View
1  backend/nodejute/jute/actions/status.js
@@ -55,7 +55,6 @@ module.exports = {
function checkResults() {
var baseDir = hub.config.outputDir,
fs = require('fs'),
- sys = require('sys'),
path = require('path'),
ret = { current_results: {} };
View
1  backend/nodejute/jute/daemon.js
@@ -2,7 +2,6 @@
var opt = require( "optimist"),
fs = require('fs'),
- sys = require('sys'),
args = opt
.usage('Usage: $0 [ --start ] [ --stop ]')
.alias('s', 'start')
View
1  backend/nodejute/jute/server.js
@@ -50,7 +50,6 @@ Create: function(hub) {
var connect = require('connect'),
sessions = require('cookie-sessions'),
os = require('os'),
- sys = require('sys'),
uuid = require('node-uuid');
hub.emit(hub.LOG, hub.INFO, "Running as " + process.getuid() + '/' + process.getgid());
View
4 backend/nodejute/jute_backend.js
@@ -35,7 +35,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// npm npm start jute -g 2&>1 > LOGFILE &
-var sys = require('sys'),
+var util = require('util'),
fs = require("fs"),
events = require("events"),
configure = require('./jute/configure'),
@@ -49,7 +49,7 @@ var sys = require('sys'),
/**
* Create our event hub
*/
-sys.inherits(eventHubF, events.EventEmitter);
+util.inherits(eventHubF, events.EventEmitter);
var eventHub = new eventHubF();
// Prime cache
View
1  backend/nodejute/jute_v8.js
@@ -36,7 +36,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var fs = require('fs')
- ,sys = require('sys')
,YUI = require("yui3").YUI
,http = require('http')
,PATH = require('path')
View
2  backend/nodejute/package.json
@@ -2,7 +2,7 @@
"name": "jute",
"description": "Javascript Unit Test Environment",
"keywords": ["selenium", "test", "testing", "unit", "tests"],
- "version": "0.0.57",
+ "version": "0.0.58",
"author": "Mark Ethan Trostler <mark@zzo.com>",
"preferGlobal": true,
"bin" : {
View
15 backend/nodejute/submit_test.js
@@ -41,7 +41,7 @@ var config = (require('./getConfig'))(),
events = require("events"),
eventHubF = function() { events.EventEmitter.call(this); },
args = opt
- .usage('Usage: $0 --test [testfile] [ --test [another testfile] ] [ --host [JUTE host] ] [ --port [JUTE host port] ] [ --sel_host [Selenium host] ] [ --sel_browser [Selenium browser spec] ] [ --seleniums # ] [ --load ] ] [ --send_output ] [ --wait ] [ --clear_results ] [ -v8 ] [ --status ] [ --snapshot ] [ --retry ] [ --phantomjs <path> ] [ --screen # ]')
+ .usage('Usage: $0 --test [testfile] [ --test [another testfile] ] [ --host [JUTE host] ] [ --port [JUTE host port] ] [ --sel_host [Selenium host] ] [ --sel_browser [Selenium browser spec] ] [ --seleniums # ] [ --load ] ] [ --send_output ] [ --wait ] [ --clear_results ] [ -v8 ] [ --status ] [ --snapshot ] [ --retry ] [ --phantomjs ] [ --screen # ]')
.alias('t', 'test')
.alias('h', 'host')
.alias('p', 'port')
@@ -63,6 +63,7 @@ var config = (require('./getConfig'))(),
.default('v8', false)
.default('snapshot', false)
.default('load', false)
+ .default('phantomjs', false)
.default('clear_results', false)
.default('seleniums', 1)
.default('sel_browser', '*firefox')
@@ -85,9 +86,9 @@ var config = (require('./getConfig'))(),
.describe('phantomjs', 'Path to phantomjs executable')
.describe('screen', 'X screen number where an X server is listening')
.argv,
- sys = require('sys'),
- qs = require('querystring'),
- http = require('http'),
+ util = require('util'),
+ qs = require('querystring'),
+ http = require('http'),
juteArgs = {};
if (!config) {
@@ -112,7 +113,7 @@ if (args.v8 && args.sel_host) {
process.exit(1);
}
-sys.inherits(eventHubF, events.EventEmitter);
+util.inherits(eventHubF, events.EventEmitter);
var eventHub = new eventHubF();
var options = {
@@ -154,7 +155,7 @@ eventHub.on('tests', function(tests) {
// Toss in Selenium stuff
if (args.phantomjs) {
- juteArgs.phantomjs = args.phantomjs;
+ juteArgs.phantomjs = 1;
juteArgs.screen = args.screen;
}
@@ -178,7 +179,7 @@ eventHub.on('tests', function(tests) {
options.headers = { 'Content-Type': 'application/json' };
// See what we got
- console.log('Submitting ' + sys.inspect(juteArgs) + ' to ' + args.host);
+ console.log('Submitting ' + util.inspect(juteArgs) + ' to ' + args.host);
// POST AWAY!
var req = http.request(options, function(res) {
View
4 backend/nodejute/test/mock/hub.js
@@ -1,11 +1,11 @@
module.exports = (function() {
var events = require("events"),
- sys = require("sys"),
+ util = require("util"),
eventHubF = function() { events.EventEmitter.call(this); this.LOG = 'log'; this.ERROR = 'error'; this.INFO = 'info'; this.DEBUG = 'debug'; },
hub;
- sys.inherits(eventHubF, events.EventEmitter);
+ util.inherits(eventHubF, events.EventEmitter);
hub = new eventHubF();
return {
Please sign in to comment.
Something went wrong with that request. Please try again.