Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make runTest work for parallel capture execution - duh

  • Loading branch information...
commit 3656c46496ec203fb0dbb9a515b582bb57881801 1 parent b3f63cf
@zzo authored
Showing with 19 additions and 11 deletions.
  1. +19 −11 backend/nodejute/jute/actions/runTest.js
View
30 backend/nodejute/jute/actions/runTest.js
@@ -55,11 +55,11 @@ module.exports = {
errors = []
;
- hub.emit(hub.LOG, hub.INFO, sys.inspect(obj));
+ hub.emit(hub.LOG, hub.INFO, 'OBJ: ' + sys.inspect(obj));
if (obj.test) {
+ multipleFromUI = true;
// 'run multiple' from UI
if (typeof obj.test == 'object') {
- multipleFromUI = true;
tests = obj.test
} else {
tests = [ obj.test ];
@@ -160,20 +160,28 @@ module.exports = {
if (multipleFromUI) {
// Only run these tests in THIS browser from the UI
- test_obj.browser = req.session.uuid;
-
- common.addTestOutput(test_obj, 'Multiple in this browser test');
-
- cache.tests_to_run.push(test_obj);
- pushed = true;
+ pushed = true;
+ for (var browser in cache.browsers) {
+ (function(b) {
+ hub.emit(hub.LOG, hub.INFO, 'Adding this test to zob: ' + b);
+ var obj = JSON.parse(JSON.stringify(test_obj));
+ obj.browser = b;
+ common.addTestOutput(obj, 'Capture test');
+ cache.tests_to_run.push(obj);
+ }(browser));
+ }
} else {
// Send to each test to each captured browser
if (!obj.load) {
pushed = true;
for (var browser in cache.browsers) {
- test_obj.browser = browser;
- common.addTestOutput(test_obj, 'Capture test');
- cache.tests_to_run.push(test_obj);
+ (function(b) {
+ hub.emit(hub.LOG, hub.INFO, 'Adding this test to zob: ' + b);
+ var obj = JSON.parse(JSON.stringify(test_obj));
+ obj.browser = b;
+ common.addTestOutput(obj, 'Capture test');
+ cache.tests_to_run.push(obj);
+ }(browser));
}
} else {
common.addTestOutput(test_obj, 'Loading this test for any browser');
Please sign in to comment.
Something went wrong with that request. Please try again.