@nsshunt/stsrunnerframework 1.0.78 → 1.0.80

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.
@@ -13,7 +13,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
13
13
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
14
14
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
15
15
 
16
- var _collectorCollectorPort, _runners, _options, _workerId, _debug, _error, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _StartRunner, _StopRunnerByRunnerById, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _processLoopExecutor2, _debug2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _BroadcastCommandToAllRunners, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _BroadcastUpdateCommandToAllRunners, _UpdateOptionsWorker, _TerminateWorker, _UpdateOptions2;
16
+ var _collectorCollectorPort, _runners, _options, _workerId, _debug, _error, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _StartRunner, _StopRunnerByRunnerById, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _processLoopExecutor2, _debug2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _UpdateOptionsRunner, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _UpdateOptionsWorker, _BroadcastCommandToAllRunners, _TerminateWorker, _HandleAllWorkers;
17
17
  const URI_BASE_VUEUTILS = "/";
18
18
  const STS_RF_RES_PREFIX = "STS_R_RF_";
19
19
  const STS_RF_RES_ENT_PREFIX = "STS_RE_RF_";
@@ -2107,7 +2107,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2107
2107
  TerminateRunner: (runner) => __privateGet(this, _TerminateRunner2).call(this, stsWorkerEx, runner),
2108
2108
  ResetRunner: (runner) => __privateGet(this, _ResetRunner2).call(this, stsWorkerEx, runner),
2109
2109
  ExecuteRunner: (runner) => __privateGet(this, _ExecuteRunner2).call(this, stsWorkerEx, runner),
2110
- UpdateOptionsRunner: (runner, executionProfile) => __privateGet(this, _UpdateOptions2).call(this, stsWorkerEx, runner, executionProfile),
2110
+ UpdateOptionsRunner: (runner, executionProfile) => __privateGet(this, _UpdateOptionsRunner).call(this, stsWorkerEx, runner, executionProfile),
2111
2111
  // Commands to execute on all runners
2112
2112
  Start: async () => __privateGet(this, _StartWorker).call(this, stsWorkerEx),
2113
2113
  Stop: async () => __privateGet(this, _StopWorker).call(this, stsWorkerEx),
@@ -2320,7 +2320,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2320
2320
  Reset: async () => __privateGet(this, _ResetRunner2).call(this, workerEx, runnerEx),
2321
2321
  Execute: async () => __privateGet(this, _ExecuteRunner2).call(this, workerEx, runnerEx),
2322
2322
  Terminate: async () => __privateGet(this, _TerminateRunner2).call(this, workerEx, runnerEx),
2323
- UpdateOptions: async (executionProfile) => __privateGet(this, _UpdateOptions2).call(this, workerEx, runnerEx, executionProfile),
2323
+ UpdateOptions: async (executionProfile) => __privateGet(this, _UpdateOptionsRunner).call(this, workerEx, runnerEx, executionProfile),
2324
2324
  on: (eventName, cb) => {
2325
2325
  if (!workerEx.runnersEvents[runnerEx.id]) {
2326
2326
  workerEx.runnersEvents[runnerEx.id] = [];
@@ -2352,62 +2352,90 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2352
2352
  __privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.StartRunner, {
2353
2353
  runner: this.CreateRunnerCopyNoHistory(runnerEx)
2354
2354
  });
2355
- return true;
2355
+ return {
2356
+ workerManagerId: __privateGet(this, _id),
2357
+ workerId: workerEx.id,
2358
+ runnerId: runnerEx.id,
2359
+ result: true
2360
+ };
2356
2361
  });
2357
2362
  __privateAdd(this, _ResetRunner2, async (workerEx, runnerEx) => {
2358
2363
  __privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ResetRunner, {
2359
2364
  runner: this.CreateRunnerCopyNoHistory(runnerEx)
2360
2365
  });
2361
- return true;
2366
+ return {
2367
+ workerManagerId: __privateGet(this, _id),
2368
+ workerId: workerEx.id,
2369
+ runnerId: runnerEx.id,
2370
+ result: true
2371
+ };
2362
2372
  });
2363
2373
  __privateAdd(this, _ExecuteRunner2, async (workerEx, runnerEx) => {
2364
2374
  __privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ExecuteRunner, {
2365
2375
  runner: this.CreateRunnerCopyNoHistory(runnerEx)
2366
2376
  });
2367
- return true;
2377
+ return {
2378
+ workerManagerId: __privateGet(this, _id),
2379
+ workerId: workerEx.id,
2380
+ runnerId: runnerEx.id,
2381
+ result: true
2382
+ };
2368
2383
  });
2369
2384
  __privateAdd(this, _StopRunner2, async (workerEx, runnerEx) => {
2370
2385
  __privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.StopRunner, {
2371
2386
  runner: this.CreateRunnerCopyNoHistory(runnerEx)
2372
2387
  });
2373
- return true;
2388
+ return {
2389
+ workerManagerId: __privateGet(this, _id),
2390
+ workerId: workerEx.id,
2391
+ runnerId: runnerEx.id,
2392
+ result: true
2393
+ };
2374
2394
  });
2375
2395
  __privateAdd(this, _TerminateRunner2, async (workerEx, runnerEx) => {
2376
2396
  __privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.TerminateRunner, {
2377
2397
  runner: this.CreateRunnerCopyNoHistory(runnerEx)
2378
2398
  });
2379
- return true;
2399
+ return {
2400
+ workerManagerId: __privateGet(this, _id),
2401
+ workerId: workerEx.id,
2402
+ runnerId: runnerEx.id,
2403
+ result: true
2404
+ };
2380
2405
  });
2381
2406
  __privateAdd(this, _PauseRunner2, async (workerEx, runnerEx) => {
2382
2407
  __privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.PauseRunner, {
2383
2408
  runner: this.CreateRunnerCopyNoHistory(runnerEx)
2384
2409
  });
2385
- return true;
2410
+ return {
2411
+ workerManagerId: __privateGet(this, _id),
2412
+ workerId: workerEx.id,
2413
+ runnerId: runnerEx.id,
2414
+ result: true
2415
+ };
2386
2416
  });
2387
2417
  __privateAdd(this, _ResumeRunner2, async (workerEx, runnerEx) => {
2388
2418
  __privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ResumeRunner, {
2389
2419
  runner: this.CreateRunnerCopyNoHistory(runnerEx)
2390
2420
  });
2391
- return true;
2421
+ return {
2422
+ workerManagerId: __privateGet(this, _id),
2423
+ workerId: workerEx.id,
2424
+ runnerId: runnerEx.id,
2425
+ result: true
2426
+ };
2392
2427
  });
2393
- __privateAdd(this, _BroadcastCommandToAllRunners, async (workerEx, command, options) => {
2394
- try {
2395
- const promArray = [];
2396
- const ids = Object.keys(workerEx.runnersEx);
2397
- ids.forEach((id) => {
2398
- const runnerEx = workerEx.runnersEx[id];
2399
- if (options) {
2400
- promArray.push(command(workerEx, runnerEx, options));
2401
- } else {
2402
- promArray.push(command(workerEx, runnerEx));
2403
- }
2404
- });
2405
- await Promise.all(promArray);
2406
- return true;
2407
- } catch (error) {
2408
- console.log(`Error in STSTestWorker:WorkerCommand: [${error}]`);
2409
- return false;
2410
- }
2428
+ __privateAdd(this, _UpdateOptionsRunner, async (workerEx, runnerEx, executionProfile) => {
2429
+ runnerEx.options.executionProfile = { ...executionProfile };
2430
+ __privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.UpdateOptions, {
2431
+ runner: this.CreateRunnerCopyNoHistory(runnerEx)
2432
+ });
2433
+ return {
2434
+ workerManagerId: __privateGet(this, _id),
2435
+ workerId: workerEx.id,
2436
+ runnerId: runnerEx.id,
2437
+ result: true
2438
+ };
2411
2439
  });
2412
2440
  __privateAdd(this, _PauseWorker, async (workerEx) => {
2413
2441
  return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _PauseRunner2));
@@ -2427,51 +2455,43 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2427
2455
  __privateAdd(this, _ExecuteWorker, async (workerEx) => {
2428
2456
  return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _ExecuteRunner2));
2429
2457
  });
2430
- __privateAdd(this, _BroadcastUpdateCommandToAllRunners, async (workerEx, command, executionProfile) => {
2458
+ // IExecutionProfile
2459
+ __privateAdd(this, _UpdateOptionsWorker, async (workerEx, executionProfile) => {
2460
+ return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _UpdateOptionsRunner), executionProfile);
2461
+ });
2462
+ __privateAdd(this, _BroadcastCommandToAllRunners, async (workerEx, command, executionProfile) => {
2431
2463
  try {
2432
- const promArray = [];
2433
- const ids = Object.keys(workerEx.runnersEx);
2434
- ids.forEach((id) => {
2435
- const runnerEx = workerEx.runnersEx[id];
2436
- if (executionProfile) {
2437
- promArray.push(command(workerEx, runnerEx, executionProfile));
2438
- } else {
2439
- promArray.push(command(workerEx, runnerEx));
2440
- }
2441
- });
2442
- await Promise.all(promArray);
2443
- return true;
2464
+ const executeCommand = async (runnerEx) => {
2465
+ const result = executionProfile ? await command(workerEx, runnerEx, executionProfile) : await command(workerEx, runnerEx);
2466
+ return {
2467
+ workerManagerId: __privateGet(this, _id),
2468
+ workerId: workerEx.id,
2469
+ runnerId: runnerEx.id,
2470
+ result
2471
+ };
2472
+ };
2473
+ const promises = Object.values(workerEx.runnersEx).map((runnerEx) => executeCommand(runnerEx));
2474
+ return await Promise.all(promises);
2444
2475
  } catch (error) {
2445
- console.log(`Error in STSTestWorker:WorkerCommand: [${error}]`);
2446
- return false;
2476
+ console.error(`Error in STSTestWorker:WorkerCommand: [${error}]`);
2477
+ return [];
2447
2478
  }
2448
2479
  });
2449
- // IExecutionProfile
2450
- __privateAdd(this, _UpdateOptionsWorker, async (workerEx, executionProfile) => {
2451
- return __privateGet(this, _BroadcastUpdateCommandToAllRunners).call(this, workerEx, __privateGet(this, _UpdateOptions2), executionProfile);
2452
- });
2453
2480
  __privateAdd(this, _TerminateWorker, async (workerEx) => {
2454
2481
  try {
2455
- await __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _TerminateRunner2));
2482
+ const retVal = await __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _TerminateRunner2));
2456
2483
  if (workerEx.worker) {
2457
2484
  workerEx.worker.terminate();
2458
2485
  __privateGet(this, _debug2).call(this, `Terminated worker: [${workerEx.id}]`);
2459
2486
  delete __privateGet(this, _workersEx)[workerEx.id];
2460
2487
  } else {
2461
2488
  }
2462
- return true;
2489
+ return retVal;
2463
2490
  } catch (error) {
2464
2491
  console.log(`Error in STSTestWorker:TerminateWorker: [${error}]`);
2465
- return false;
2492
+ return [];
2466
2493
  }
2467
2494
  });
2468
- __privateAdd(this, _UpdateOptions2, async (workerEx, runnerEx, executionProfile) => {
2469
- runnerEx.options.executionProfile = { ...executionProfile };
2470
- __privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.UpdateOptions, {
2471
- runner: this.CreateRunnerCopyNoHistory(runnerEx)
2472
- });
2473
- return true;
2474
- });
2475
2495
  __publicField(this, "GetNextAvailableWorker", () => {
2476
2496
  let leastRunnerWorker = null;
2477
2497
  for (const [, stsWorker] of Object.entries(this.WorkersEx)) {
@@ -2498,61 +2518,48 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2498
2518
  }
2499
2519
  return busyWorker;
2500
2520
  });
2521
+ // IExecuteRunnerActionResult[]
2522
+ __privateAdd(this, _HandleAllWorkers, async (action, options) => {
2523
+ const promises = Object.values(this.WorkersEx).map(async (worker) => {
2524
+ if (action === "UpdateOptions") {
2525
+ return {
2526
+ workerManagerId: __privateGet(this, _id),
2527
+ workerId: worker.id,
2528
+ executeRunnerActionResults: await worker[action](options)
2529
+ };
2530
+ } else {
2531
+ return {
2532
+ workerManagerId: __privateGet(this, _id),
2533
+ workerId: worker.id,
2534
+ executeRunnerActionResults: await worker[action]()
2535
+ };
2536
+ }
2537
+ });
2538
+ return Promise.all(promises);
2539
+ });
2501
2540
  __publicField(this, "StartAllWorkers", async () => {
2502
- const promArray = [];
2503
- for (const [, stsWorker] of Object.entries(this.WorkersEx)) {
2504
- promArray.push(stsWorker.Start());
2505
- }
2506
- return await Promise.all(promArray);
2541
+ return __privateGet(this, _HandleAllWorkers).call(this, "Start");
2507
2542
  });
2508
- __publicField(this, "StopAllWorkers", async () => {
2509
- const promArray = [];
2510
- for (const [, stsWorker] of Object.entries(this.WorkersEx)) {
2511
- promArray.push(stsWorker.Stop());
2512
- }
2513
- return await Promise.all(promArray);
2543
+ __publicField(this, "StopAllWorkers", () => {
2544
+ return __privateGet(this, _HandleAllWorkers).call(this, "Stop");
2514
2545
  });
2515
- __publicField(this, "PauseAllWorkers", async () => {
2516
- const promArray = [];
2517
- for (const [, stsWorker] of Object.entries(this.WorkersEx)) {
2518
- promArray.push(stsWorker.Pause());
2519
- }
2520
- return await Promise.all(promArray);
2546
+ __publicField(this, "PauseAllWorkers", () => {
2547
+ return __privateGet(this, _HandleAllWorkers).call(this, "Pause");
2521
2548
  });
2522
2549
  __publicField(this, "ResumeAllWorkers", async () => {
2523
- const promArray = [];
2524
- for (const [, stsWorker] of Object.entries(this.WorkersEx)) {
2525
- promArray.push(stsWorker.Resume());
2526
- }
2527
- return await Promise.all(promArray);
2550
+ return __privateGet(this, _HandleAllWorkers).call(this, "Resume");
2528
2551
  });
2529
2552
  __publicField(this, "ExecuteAllWorkers", async () => {
2530
- const promArray = [];
2531
- for (const [, stsWorker] of Object.entries(this.WorkersEx)) {
2532
- promArray.push(stsWorker.Execute());
2533
- }
2534
- return await Promise.all(promArray);
2553
+ return __privateGet(this, _HandleAllWorkers).call(this, "Execute");
2535
2554
  });
2536
2555
  __publicField(this, "ResetAllWorkers", async () => {
2537
- const promArray = [];
2538
- for (const [, stsWorker] of Object.entries(this.WorkersEx)) {
2539
- promArray.push(stsWorker.Reset());
2540
- }
2541
- return await Promise.all(promArray);
2542
- });
2543
- __publicField(this, "UpdateAllWorkers", async (options) => {
2544
- const promArray = [];
2545
- for (const [, stsWorker] of Object.entries(this.WorkersEx)) {
2546
- promArray.push(stsWorker.UpdateOptions(options));
2547
- }
2548
- return await Promise.all(promArray);
2556
+ return __privateGet(this, _HandleAllWorkers).call(this, "Reset");
2549
2557
  });
2550
2558
  __publicField(this, "TerminateAllWorkers", async () => {
2551
- const promArray = [];
2552
- for (const [, stsWorker] of Object.entries(this.WorkersEx)) {
2553
- promArray.push(stsWorker.Terminate());
2554
- }
2555
- return await Promise.all(promArray);
2559
+ return __privateGet(this, _HandleAllWorkers).call(this, "Terminate");
2560
+ });
2561
+ __publicField(this, "UpdateAllWorkers", async (options) => {
2562
+ return __privateGet(this, _HandleAllWorkers).call(this, "UpdateOptions", options);
2556
2563
  });
2557
2564
  __privateSet(this, _id, v4());
2558
2565
  if (options) {
@@ -2644,17 +2651,17 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2644
2651
  _TerminateRunner2 = new WeakMap();
2645
2652
  _PauseRunner2 = new WeakMap();
2646
2653
  _ResumeRunner2 = new WeakMap();
2647
- _BroadcastCommandToAllRunners = new WeakMap();
2654
+ _UpdateOptionsRunner = new WeakMap();
2648
2655
  _PauseWorker = new WeakMap();
2649
2656
  _ResumeWorker = new WeakMap();
2650
2657
  _StopWorker = new WeakMap();
2651
2658
  _StartWorker = new WeakMap();
2652
2659
  _ResetWorker = new WeakMap();
2653
2660
  _ExecuteWorker = new WeakMap();
2654
- _BroadcastUpdateCommandToAllRunners = new WeakMap();
2655
2661
  _UpdateOptionsWorker = new WeakMap();
2662
+ _BroadcastCommandToAllRunners = new WeakMap();
2656
2663
  _TerminateWorker = new WeakMap();
2657
- _UpdateOptions2 = new WeakMap();
2664
+ _HandleAllWorkers = new WeakMap();
2658
2665
  exports2.IRunnerState = IRunnerState;
2659
2666
  exports2.IWorkerState = IWorkerState;
2660
2667
  exports2.PublishMessageCommandsTestRunner = PublishMessageCommandsTestRunner;