Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature alexamil 1508355200070 #199

Merged
merged 14 commits into from
Oct 19, 2017
Merged
Prev Previous commit
Next Next commit
pdev:set
  • Loading branch information
ORESoftware committed Oct 19, 2017
commit 11544367c0eb04d12553756e2c1fd986babe3b11
3 changes: 2 additions & 1 deletion lib/runner-helpers/multi-process/add-to-run-queue.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import { IGanttData } from "../socket-cp-hash";
export declare const makeAddToRunQueue: (runnerObj: Object, args: string[], runQueue: Object, projectRoot: string, cpHash: Object, forkedCPs: any[], onExitFn: Function) => (file: string, shortFile: string, stdout: string, gd: IGanttData) => void;
import { AsyncQueue } from "async";
export declare const makeAddToRunQueue: (runnerObj: Object, args: string[], runQueue: AsyncQueue<Function>, projectRoot: string, cpHash: Object, forkedCPs: any[], onExitFn: Function) => (file: string, shortFile: string, stdout: string, gd: IGanttData) => void;
6 changes: 4 additions & 2 deletions lib/runner-helpers/multi-process/add-to-run-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import {IGlobalSumanObj} from "suman-types/dts/global";
import {IGanttData} from "../socket-cp-hash";
import {IRunnerRunFn, ISumanChildProcess} from "suman-types/dts/runner";
import {AsyncQueue} from "async";

//polyfills
const process = require('suman-browser-polyfills/modules/process');
Expand Down Expand Up @@ -32,8 +33,9 @@ const runChildPath = require.resolve(__dirname + '/../run-child.js');

//////////////////////////////////////////////////////////////////////

export const makeAddToRunQueue = function (runnerObj: Object, args: Array<string>, runQueue: Object, projectRoot: string,
cpHash: Object, forkedCPs: Array<any>, onExitFn: Function) {
export const makeAddToRunQueue = function (runnerObj: Object, args: Array<string>, runQueue: AsyncQueue<Function>,
projectRoot: string, cpHash: Object, forkedCPs: Array<any>,
onExitFn: Function) {

const {sumanOpts, sumanConfig, maxProcs} = _suman;
const execFile = path.resolve(__dirname + '/../run-child.js');
Expand Down
3 changes: 2 additions & 1 deletion lib/runner-helpers/multi-process/add-to-transpile-queue.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ITableRows } from "suman-types/dts/runner";
import { AsyncQueue } from "async";
import { IGanttHash } from "../socket-cp-hash";
export declare const makeAddToTranspileQueue: (f: string, transpileQueue: Object, tableRows: ITableRows, ganttHash: IGanttHash, projectRoot: string) => (fileShortAndFull: string[][]) => void;
export declare const makeAddToTranspileQueue: (f: string, transpileQueue: AsyncQueue<Function>, tableRows: ITableRows, ganttHash: IGanttHash, projectRoot: string) => (fileShortAndFull: string[][]) => void;
3 changes: 2 additions & 1 deletion lib/runner-helpers/multi-process/add-to-transpile-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//dts
import {IGlobalSumanObj} from "suman-types/dts/global";
import {ITableRows} from "suman-types/dts/runner";
import {AsyncQueue} from "async";

//polyfills
const process = require('suman-browser-polyfills/modules/process');
Expand All @@ -26,7 +27,7 @@ import {IGanttHash} from "../socket-cp-hash";

///////////////////////////////////////////////////////////////////////////////////////////////

export const makeAddToTranspileQueue = function (f: string, transpileQueue: Object, tableRows: ITableRows,
export const makeAddToTranspileQueue = function (f: string, transpileQueue: AsyncQueue<Function>, tableRows: ITableRows,
ganttHash: IGanttHash, projectRoot: string) {

const {sumanOpts} = _suman;
Expand Down
6 changes: 3 additions & 3 deletions lib/runner-helpers/multiple-process-each-on-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports.makeOnExitFn = function (runnerObj, tableRows, messages, forkedCPs, befo
n.sumanExitCode = gd.sumanExitCode = code;
n.removeAllListeners();
var sumanOpts = _suman.sumanOpts;
var transpileQ = transpile_queue_1.getTranspileQueue();
var transpileQueue = transpile_queue_1.getTranspileQueue();
resultBroadcaster.emit(String(suman_events_1.events.TEST_FILE_CHILD_PROCESS_EXITED), {
testPath: n.testPath,
exitCode: code
Expand All @@ -55,10 +55,10 @@ exports.makeOnExitFn = function (runnerObj, tableRows, messages, forkedCPs, befo
messages.push({ code: code, signal: signal });
tableRows[n.shortTestPath].actualExitCode = n.expectedExitCode !== undefined ?
(n.expectedExitCode + '/' + originalExitCode) : originalExitCode;
if (weHaveBailed(code) || (allDone(runQueue) && allDone(transpileQ))) {
if (weHaveBailed(code) || (allDone(runQueue) && allDone(transpileQueue))) {
if (runnerObj.bailed) {
runQueue.kill();
transpileQ.kill();
transpileQueue.kill();
console.log('\n');
_suman.logError(chalk.magenta('We have ' + chalk.red.bold('bailed') +
' the test runner because a child process experienced an error and exitted with a non-zero code.'));
Expand Down
8 changes: 4 additions & 4 deletions lib/runner-helpers/multiple-process-each-on-exit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const makeOnExitFn = function (runnerObj: IRunnerObj, tableRows: ITableRo
n.removeAllListeners();

const sumanOpts = _suman.sumanOpts;
const transpileQ = getTranspileQueue();
const transpileQueue = getTranspileQueue();

resultBroadcaster.emit(String(events.TEST_FILE_CHILD_PROCESS_EXITED), {
testPath: n.testPath,
Expand Down Expand Up @@ -90,14 +90,14 @@ export const makeOnExitFn = function (runnerObj: IRunnerObj, tableRows: ITableRo
tableRows[n.shortTestPath].actualExitCode = n.expectedExitCode !== undefined ?
(n.expectedExitCode + '/' + originalExitCode) : originalExitCode;

// console.log('transpileQ:', util.inspect(transpileQ));
// console.log('transpileQ:', util.inspect(transpileQueue));

if (weHaveBailed(code) || (allDone(runQueue) && allDone(transpileQ))) {
if (weHaveBailed(code) || (allDone(runQueue) && allDone(transpileQueue))) {

if (runnerObj.bailed) {

runQueue.kill();
transpileQ.kill();
transpileQueue.kill();

console.log('\n');
_suman.logError(chalk.magenta('We have ' + chalk.red.bold('bailed') +
Expand Down
2 changes: 1 addition & 1 deletion test/.suman/gantt-4.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
"status": "KILLED"
}];

let tasksRaw = JSON.parse('[{"startDate":1508435981237,"endDate":1508435981786,"transformStartDate":null,"transformEndDate":null,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/dev/node/1.test.js","status":"FAILED"},{"startDate":1508435980336,"endDate":1508435981287,"transformStartDate":null,"transformEndDate":null,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/dev/node/5.test.js","status":"FAILED"},{"startDate":1508435980307,"endDate":1508435981237,"transformStartDate":null,"transformEndDate":null,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/dev/node/2.test.js","status":"FAILED"},{"startDate":1508435980302,"endDate":1508435981291,"transformStartDate":null,"transformEndDate":null,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/dev/node/3.test.js","status":"SUCCEEDED"},{"startDate":1508435980298,"endDate":1508435981387,"transformStartDate":null,"transformEndDate":null,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/dev/node/4.test.js","status":"SUCCEEDED"},{"startDate":1508435980295,"endDate":1508435981237,"transformStartDate":null,"transformEndDate":null,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/dev/node/6.test.js","status":"FAILED"},{"startDate":1508435980291,"endDate":1508435982115,"transformStartDate":null,"transformEndDate":null,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/dev/node/events.test.js","status":"SUCCEEDED"},{"startDate":1508435980288,"endDate":1508435981304,"transformStartDate":null,"transformEndDate":null,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/dev/node/injection.test.js","status":"SUCCEEDED"},{"startDate":1508435980283,"endDate":1508435981708,"transformStartDate":null,"transformEndDate":null,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/dev/node/simple.js","status":"SUCCEEDED"}]');
let tasksRaw = JSON.parse('[{"startDate":1508437961156,"endDate":1508437961707,"transformStartDate":1508437959118,"transformEndDate":1508437961152,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/exp/tap-output/@src/tap-producer1.ts","status":"SUCCEEDED"},{"startDate":1508437959255,"endDate":1508437959799,"transformStartDate":1508437959122,"transformEndDate":1508437959247,"taskName":"/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/exp/tap-output/@src/tap-producer2.ts","status":"FAILED"}]');

let tasks = [];

Expand Down