@nsshunt/stsrunnerframework 1.0.80 → 1.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stsrunnerframework.mjs +50 -52
- package/dist/stsrunnerframework.mjs.map +1 -1
- package/dist/stsrunnerframework.umd.js +50 -52
- package/dist/stsrunnerframework.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/commonTypes.d.ts +24 -24
- package/types/commonTypes.d.ts.map +1 -1
- package/types/workerManager.d.ts +8 -8
- package/types/workerManager.d.ts.map +1 -1
|
@@ -2049,8 +2049,7 @@ class STSWorkerManager {
|
|
|
2049
2049
|
if (runnerEx) {
|
|
2050
2050
|
if (runnerEx.publishInstrumentController) {
|
|
2051
2051
|
__privateGet(this, _debug2).call(this, chalk.grey(`Ending publish for runner: [${JSON.stringify(runnerEx.asyncRunnerContext)}]`));
|
|
2052
|
-
|
|
2053
|
-
await Sleep(250);
|
|
2052
|
+
runnerEx.publishInstrumentController.EndPublish();
|
|
2054
2053
|
}
|
|
2055
2054
|
const runner = this.CreateRunnerCopy(runnerEx);
|
|
2056
2055
|
__privateGet(this, _archiveList).push(runner);
|
|
@@ -2107,14 +2106,14 @@ class STSWorkerManager {
|
|
|
2107
2106
|
ExecuteRunner: (runner) => __privateGet(this, _ExecuteRunner2).call(this, stsWorkerEx, runner),
|
|
2108
2107
|
UpdateOptionsRunner: (runner, executionProfile) => __privateGet(this, _UpdateOptionsRunner).call(this, stsWorkerEx, runner, executionProfile),
|
|
2109
2108
|
// Commands to execute on all runners
|
|
2110
|
-
Start:
|
|
2111
|
-
Stop:
|
|
2112
|
-
Pause:
|
|
2113
|
-
Resume:
|
|
2114
|
-
Terminate:
|
|
2115
|
-
Reset:
|
|
2116
|
-
Execute:
|
|
2117
|
-
UpdateOptions:
|
|
2109
|
+
Start: () => __privateGet(this, _StartWorker).call(this, stsWorkerEx),
|
|
2110
|
+
Stop: () => __privateGet(this, _StopWorker).call(this, stsWorkerEx),
|
|
2111
|
+
Pause: () => __privateGet(this, _PauseWorker).call(this, stsWorkerEx),
|
|
2112
|
+
Resume: () => __privateGet(this, _ResumeWorker).call(this, stsWorkerEx),
|
|
2113
|
+
Terminate: () => __privateGet(this, _TerminateWorker).call(this, stsWorkerEx),
|
|
2114
|
+
Reset: () => __privateGet(this, _ResetWorker).call(this, stsWorkerEx),
|
|
2115
|
+
Execute: () => __privateGet(this, _ExecuteWorker).call(this, stsWorkerEx),
|
|
2116
|
+
UpdateOptions: (executionProfile) => __privateGet(this, _UpdateOptionsWorker).call(this, stsWorkerEx, executionProfile)
|
|
2118
2117
|
};
|
|
2119
2118
|
if (__privateGet(this, _STSInstrumentController)) {
|
|
2120
2119
|
__privateGet(this, _STSInstrumentController).LogEx(chalk.yellow(`pid: [${process.pid}] Creating new worker: [${stsWorkerEx.id}]`));
|
|
@@ -2187,7 +2186,7 @@ class STSWorkerManager {
|
|
|
2187
2186
|
processMessage(publishMessagePayload);
|
|
2188
2187
|
});
|
|
2189
2188
|
} else {
|
|
2190
|
-
stsWorkerEx.messagePort.onmessage =
|
|
2189
|
+
stsWorkerEx.messagePort.onmessage = (data) => {
|
|
2191
2190
|
publishMessagePayload = data.data;
|
|
2192
2191
|
processMessage(publishMessagePayload);
|
|
2193
2192
|
};
|
|
@@ -2311,14 +2310,14 @@ class STSWorkerManager {
|
|
|
2311
2310
|
rx: 0,
|
|
2312
2311
|
tx: 0
|
|
2313
2312
|
},
|
|
2314
|
-
Start:
|
|
2315
|
-
Stop:
|
|
2316
|
-
Pause:
|
|
2317
|
-
Resume:
|
|
2318
|
-
Reset:
|
|
2319
|
-
Execute:
|
|
2320
|
-
Terminate:
|
|
2321
|
-
UpdateOptions:
|
|
2313
|
+
Start: () => __privateGet(this, _StartRunner2).call(this, workerEx, runnerEx),
|
|
2314
|
+
Stop: () => __privateGet(this, _StopRunner2).call(this, workerEx, runnerEx),
|
|
2315
|
+
Pause: () => __privateGet(this, _PauseRunner2).call(this, workerEx, runnerEx),
|
|
2316
|
+
Resume: () => __privateGet(this, _ResumeRunner2).call(this, workerEx, runnerEx),
|
|
2317
|
+
Reset: () => __privateGet(this, _ResetRunner2).call(this, workerEx, runnerEx),
|
|
2318
|
+
Execute: () => __privateGet(this, _ExecuteRunner2).call(this, workerEx, runnerEx),
|
|
2319
|
+
Terminate: () => __privateGet(this, _TerminateRunner2).call(this, workerEx, runnerEx),
|
|
2320
|
+
UpdateOptions: (executionProfile) => __privateGet(this, _UpdateOptionsRunner).call(this, workerEx, runnerEx, executionProfile),
|
|
2322
2321
|
on: (eventName, cb) => {
|
|
2323
2322
|
if (!workerEx.runnersEvents[runnerEx.id]) {
|
|
2324
2323
|
workerEx.runnersEvents[runnerEx.id] = [];
|
|
@@ -2346,7 +2345,7 @@ class STSWorkerManager {
|
|
|
2346
2345
|
__privateGet(this, _debug2).call(this, `#PostMessageToWorker`);
|
|
2347
2346
|
workerEx.messagePort.postMessage({ command, payload });
|
|
2348
2347
|
});
|
|
2349
|
-
__privateAdd(this, _StartRunner2,
|
|
2348
|
+
__privateAdd(this, _StartRunner2, (workerEx, runnerEx) => {
|
|
2350
2349
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.StartRunner, {
|
|
2351
2350
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2352
2351
|
});
|
|
@@ -2357,7 +2356,7 @@ class STSWorkerManager {
|
|
|
2357
2356
|
result: true
|
|
2358
2357
|
};
|
|
2359
2358
|
});
|
|
2360
|
-
__privateAdd(this, _ResetRunner2,
|
|
2359
|
+
__privateAdd(this, _ResetRunner2, (workerEx, runnerEx) => {
|
|
2361
2360
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ResetRunner, {
|
|
2362
2361
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2363
2362
|
});
|
|
@@ -2368,7 +2367,7 @@ class STSWorkerManager {
|
|
|
2368
2367
|
result: true
|
|
2369
2368
|
};
|
|
2370
2369
|
});
|
|
2371
|
-
__privateAdd(this, _ExecuteRunner2,
|
|
2370
|
+
__privateAdd(this, _ExecuteRunner2, (workerEx, runnerEx) => {
|
|
2372
2371
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ExecuteRunner, {
|
|
2373
2372
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2374
2373
|
});
|
|
@@ -2379,7 +2378,7 @@ class STSWorkerManager {
|
|
|
2379
2378
|
result: true
|
|
2380
2379
|
};
|
|
2381
2380
|
});
|
|
2382
|
-
__privateAdd(this, _StopRunner2,
|
|
2381
|
+
__privateAdd(this, _StopRunner2, (workerEx, runnerEx) => {
|
|
2383
2382
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.StopRunner, {
|
|
2384
2383
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2385
2384
|
});
|
|
@@ -2390,7 +2389,7 @@ class STSWorkerManager {
|
|
|
2390
2389
|
result: true
|
|
2391
2390
|
};
|
|
2392
2391
|
});
|
|
2393
|
-
__privateAdd(this, _TerminateRunner2,
|
|
2392
|
+
__privateAdd(this, _TerminateRunner2, (workerEx, runnerEx) => {
|
|
2394
2393
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.TerminateRunner, {
|
|
2395
2394
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2396
2395
|
});
|
|
@@ -2401,7 +2400,7 @@ class STSWorkerManager {
|
|
|
2401
2400
|
result: true
|
|
2402
2401
|
};
|
|
2403
2402
|
});
|
|
2404
|
-
__privateAdd(this, _PauseRunner2,
|
|
2403
|
+
__privateAdd(this, _PauseRunner2, (workerEx, runnerEx) => {
|
|
2405
2404
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.PauseRunner, {
|
|
2406
2405
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2407
2406
|
});
|
|
@@ -2412,7 +2411,7 @@ class STSWorkerManager {
|
|
|
2412
2411
|
result: true
|
|
2413
2412
|
};
|
|
2414
2413
|
});
|
|
2415
|
-
__privateAdd(this, _ResumeRunner2,
|
|
2414
|
+
__privateAdd(this, _ResumeRunner2, (workerEx, runnerEx) => {
|
|
2416
2415
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ResumeRunner, {
|
|
2417
2416
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2418
2417
|
});
|
|
@@ -2423,7 +2422,7 @@ class STSWorkerManager {
|
|
|
2423
2422
|
result: true
|
|
2424
2423
|
};
|
|
2425
2424
|
});
|
|
2426
|
-
__privateAdd(this, _UpdateOptionsRunner,
|
|
2425
|
+
__privateAdd(this, _UpdateOptionsRunner, (workerEx, runnerEx, executionProfile) => {
|
|
2427
2426
|
runnerEx.options.executionProfile = { ...executionProfile };
|
|
2428
2427
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.UpdateOptions, {
|
|
2429
2428
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
@@ -2435,32 +2434,32 @@ class STSWorkerManager {
|
|
|
2435
2434
|
result: true
|
|
2436
2435
|
};
|
|
2437
2436
|
});
|
|
2438
|
-
__privateAdd(this, _PauseWorker,
|
|
2437
|
+
__privateAdd(this, _PauseWorker, (workerEx) => {
|
|
2439
2438
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _PauseRunner2));
|
|
2440
2439
|
});
|
|
2441
|
-
__privateAdd(this, _ResumeWorker,
|
|
2440
|
+
__privateAdd(this, _ResumeWorker, (workerEx) => {
|
|
2442
2441
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _ResumeRunner2));
|
|
2443
2442
|
});
|
|
2444
|
-
__privateAdd(this, _StopWorker,
|
|
2443
|
+
__privateAdd(this, _StopWorker, (workerEx) => {
|
|
2445
2444
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _StopRunner2));
|
|
2446
2445
|
});
|
|
2447
|
-
__privateAdd(this, _StartWorker,
|
|
2446
|
+
__privateAdd(this, _StartWorker, (workerEx) => {
|
|
2448
2447
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _StartRunner2));
|
|
2449
2448
|
});
|
|
2450
|
-
__privateAdd(this, _ResetWorker,
|
|
2449
|
+
__privateAdd(this, _ResetWorker, (workerEx) => {
|
|
2451
2450
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _ResetRunner2));
|
|
2452
2451
|
});
|
|
2453
|
-
__privateAdd(this, _ExecuteWorker,
|
|
2452
|
+
__privateAdd(this, _ExecuteWorker, (workerEx) => {
|
|
2454
2453
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _ExecuteRunner2));
|
|
2455
2454
|
});
|
|
2456
2455
|
// IExecutionProfile
|
|
2457
|
-
__privateAdd(this, _UpdateOptionsWorker,
|
|
2456
|
+
__privateAdd(this, _UpdateOptionsWorker, (workerEx, executionProfile) => {
|
|
2458
2457
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _UpdateOptionsRunner), executionProfile);
|
|
2459
2458
|
});
|
|
2460
|
-
__privateAdd(this, _BroadcastCommandToAllRunners,
|
|
2459
|
+
__privateAdd(this, _BroadcastCommandToAllRunners, (workerEx, command, executionProfile) => {
|
|
2461
2460
|
try {
|
|
2462
|
-
const executeCommand =
|
|
2463
|
-
const result = executionProfile ?
|
|
2461
|
+
const executeCommand = (runnerEx) => {
|
|
2462
|
+
const result = executionProfile ? command(workerEx, runnerEx, executionProfile) : command(workerEx, runnerEx);
|
|
2464
2463
|
return {
|
|
2465
2464
|
workerManagerId: __privateGet(this, _id),
|
|
2466
2465
|
workerId: workerEx.id,
|
|
@@ -2468,16 +2467,15 @@ class STSWorkerManager {
|
|
|
2468
2467
|
result
|
|
2469
2468
|
};
|
|
2470
2469
|
};
|
|
2471
|
-
|
|
2472
|
-
return await Promise.all(promises);
|
|
2470
|
+
return Object.values(workerEx.runnersEx).map((runnerEx) => executeCommand(runnerEx));
|
|
2473
2471
|
} catch (error) {
|
|
2474
2472
|
console.error(`Error in STSTestWorker:WorkerCommand: [${error}]`);
|
|
2475
2473
|
return [];
|
|
2476
2474
|
}
|
|
2477
2475
|
});
|
|
2478
|
-
__privateAdd(this, _TerminateWorker,
|
|
2476
|
+
__privateAdd(this, _TerminateWorker, (workerEx) => {
|
|
2479
2477
|
try {
|
|
2480
|
-
const retVal =
|
|
2478
|
+
const retVal = __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _TerminateRunner2));
|
|
2481
2479
|
if (workerEx.worker) {
|
|
2482
2480
|
workerEx.worker.terminate();
|
|
2483
2481
|
__privateGet(this, _debug2).call(this, `Terminated worker: [${workerEx.id}]`);
|
|
@@ -2517,25 +2515,25 @@ class STSWorkerManager {
|
|
|
2517
2515
|
return busyWorker;
|
|
2518
2516
|
});
|
|
2519
2517
|
// IExecuteRunnerActionResult[]
|
|
2520
|
-
__privateAdd(this, _HandleAllWorkers,
|
|
2521
|
-
const
|
|
2518
|
+
__privateAdd(this, _HandleAllWorkers, (action, options) => {
|
|
2519
|
+
const retVal = Object.values(this.WorkersEx).map((worker) => {
|
|
2522
2520
|
if (action === "UpdateOptions") {
|
|
2523
2521
|
return {
|
|
2524
2522
|
workerManagerId: __privateGet(this, _id),
|
|
2525
2523
|
workerId: worker.id,
|
|
2526
|
-
executeRunnerActionResults:
|
|
2524
|
+
executeRunnerActionResults: worker[action](options)
|
|
2527
2525
|
};
|
|
2528
2526
|
} else {
|
|
2529
2527
|
return {
|
|
2530
2528
|
workerManagerId: __privateGet(this, _id),
|
|
2531
2529
|
workerId: worker.id,
|
|
2532
|
-
executeRunnerActionResults:
|
|
2530
|
+
executeRunnerActionResults: worker[action]()
|
|
2533
2531
|
};
|
|
2534
2532
|
}
|
|
2535
2533
|
});
|
|
2536
|
-
return
|
|
2534
|
+
return retVal;
|
|
2537
2535
|
});
|
|
2538
|
-
__publicField(this, "StartAllWorkers",
|
|
2536
|
+
__publicField(this, "StartAllWorkers", () => {
|
|
2539
2537
|
return __privateGet(this, _HandleAllWorkers).call(this, "Start");
|
|
2540
2538
|
});
|
|
2541
2539
|
__publicField(this, "StopAllWorkers", () => {
|
|
@@ -2544,19 +2542,19 @@ class STSWorkerManager {
|
|
|
2544
2542
|
__publicField(this, "PauseAllWorkers", () => {
|
|
2545
2543
|
return __privateGet(this, _HandleAllWorkers).call(this, "Pause");
|
|
2546
2544
|
});
|
|
2547
|
-
__publicField(this, "ResumeAllWorkers",
|
|
2545
|
+
__publicField(this, "ResumeAllWorkers", () => {
|
|
2548
2546
|
return __privateGet(this, _HandleAllWorkers).call(this, "Resume");
|
|
2549
2547
|
});
|
|
2550
|
-
__publicField(this, "ExecuteAllWorkers",
|
|
2548
|
+
__publicField(this, "ExecuteAllWorkers", () => {
|
|
2551
2549
|
return __privateGet(this, _HandleAllWorkers).call(this, "Execute");
|
|
2552
2550
|
});
|
|
2553
|
-
__publicField(this, "ResetAllWorkers",
|
|
2551
|
+
__publicField(this, "ResetAllWorkers", () => {
|
|
2554
2552
|
return __privateGet(this, _HandleAllWorkers).call(this, "Reset");
|
|
2555
2553
|
});
|
|
2556
|
-
__publicField(this, "TerminateAllWorkers",
|
|
2554
|
+
__publicField(this, "TerminateAllWorkers", () => {
|
|
2557
2555
|
return __privateGet(this, _HandleAllWorkers).call(this, "Terminate");
|
|
2558
2556
|
});
|
|
2559
|
-
__publicField(this, "UpdateAllWorkers",
|
|
2557
|
+
__publicField(this, "UpdateAllWorkers", (options) => {
|
|
2560
2558
|
return __privateGet(this, _HandleAllWorkers).call(this, "UpdateOptions", options);
|
|
2561
2559
|
});
|
|
2562
2560
|
__privateSet(this, _id, v4());
|