@nsshunt/stsrunnerframework 1.0.61 → 1.0.63

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, _options3, _workerId, _debug, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _StartRunner, _StopRunnerByRunnerById, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options4, _STSInstrumentController, _telemetryProcessor, _debug2, _STSWorkerManager_instances, CreateRunnerCopy_fn, _SetRunnerIntoWorker, _ProcessTelemetry, _RunnerStateChange, _ProcessCompleted, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _BroadcastCommandToAllRunners, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _BroadcastUpdateCommandToAllRunners, _UpdateOptionsWorker, _TerminateWorker, _UpdateOptions2, _options5, _rest01Client, _accessToken2, _agentManager, _authUtilsNode, _GetAccessToken;
16
+ var _collectorCollectorPort, _runners, _options3, _workerId, _debug, _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, _options4, _STSInstrumentController, _telemetryProcessor, _debug2, _STSWorkerManager_instances, CreateRunnerCopy_fn, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitEvent, _RunnerStateChange, _ProcessCompleted, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _BroadcastCommandToAllRunners, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _BroadcastUpdateCommandToAllRunners, _UpdateOptionsWorker, _TerminateWorker, _UpdateOptions2, _options5, _rest01Client, _accessToken2, _agentManager, _authUtilsNode, _GetAccessToken;
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_";
@@ -1611,6 +1611,13 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1611
1611
  }
1612
1612
  return false;
1613
1613
  });
1614
+ __privateAdd(this, _IsCompletedById, (id) => {
1615
+ const state = __privateGet(this, _runners)[id].runner.state;
1616
+ if (state === IRunnerState.error || state === IRunnerState.completed || state === IRunnerState.stopped || state === IRunnerState.terminated) {
1617
+ return true;
1618
+ }
1619
+ return false;
1620
+ });
1614
1621
  __privateAdd(this, _GetRunnerIterationById, (id) => {
1615
1622
  return __privateGet(this, _runners)[id].runner.iteration;
1616
1623
  });
@@ -1674,8 +1681,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1674
1681
  }
1675
1682
  ExecuteLoop();
1676
1683
  } else {
1677
- await stsutils.Sleep(50);
1678
- ExecuteLoop();
1684
+ if (!__privateGet(this, _IsCompletedById).call(this, runnerId)) {
1685
+ await stsutils.Sleep(50);
1686
+ ExecuteLoop();
1687
+ }
1679
1688
  }
1680
1689
  } else {
1681
1690
  await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).Completed();
@@ -1831,6 +1840,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1831
1840
  _UpdateRunnerStateById = new WeakMap();
1832
1841
  _GetAllRunners = new WeakMap();
1833
1842
  _CanExecuteNextIterationById = new WeakMap();
1843
+ _IsCompletedById = new WeakMap();
1834
1844
  _GetRunnerIterationById = new WeakMap();
1835
1845
  _ResetRunnerIterationById = new WeakMap();
1836
1846
  _IncRunnerIterationById = new WeakMap();
@@ -2153,33 +2163,33 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2153
2163
  runnerEx.instrumentData.message = [];
2154
2164
  }
2155
2165
  __privateGet(this, _telemetryProcessor).ProcessTelemetry(runnerEx.publishInstrumentController, runnerEx.instrumentData);
2156
- if (workerEx.runnersEvents[runner.id]) {
2157
- const runnersEvents = workerEx.runnersEvents[runner.id];
2158
- runnersEvents.forEach((ev) => {
2159
- if (ev.eventName.localeCompare("Telemetry") === 0) {
2160
- ev.cb(runnerEx.instrumentData);
2161
- }
2162
- });
2163
- }
2166
+ __privateGet(this, _EmitEvent).call(this, "Telemetry", workerEx, runner.id);
2164
2167
  }
2165
2168
  });
2169
+ __privateAdd(this, _EmitEvent, (eventName, workerEx, runnerId) => {
2170
+ if (workerEx.runnersEvents[runnerId]) {
2171
+ const runnersEvents = workerEx.runnersEvents[runnerId];
2172
+ runnersEvents.forEach((ev) => {
2173
+ if (ev.eventName.localeCompare(eventName) === 0) {
2174
+ ev.cb(workerEx.runnersEx[runnerId]);
2175
+ }
2176
+ });
2177
+ }
2178
+ });
2179
+ //@@ make this have an event
2180
+ //@@ make refactor event to own method
2181
+ //@@ check for other events to capture
2166
2182
  __privateAdd(this, _RunnerStateChange, (workerEx, payloadContents) => {
2167
2183
  const { runner } = payloadContents;
2168
2184
  if (workerEx.runnersEx[runner.id]) {
2169
2185
  const runnerEx = workerEx.runnersEx[runner.id];
2170
2186
  runnerEx.state = runner.state;
2187
+ __privateGet(this, _EmitEvent).call(this, "StateChange", workerEx, runner.id);
2171
2188
  }
2172
2189
  });
2173
2190
  __privateAdd(this, _ProcessCompleted, (workerEx, payloadContents) => {
2174
2191
  const { runner } = payloadContents;
2175
- if (workerEx.runnersEvents[runner.id]) {
2176
- const runnersEvents = workerEx.runnersEvents[runner.id];
2177
- runnersEvents.forEach((ev) => {
2178
- if (ev.eventName.localeCompare("Completed") === 0) {
2179
- ev.cb(workerEx.runnersEx[runner.id].instrumentData);
2180
- }
2181
- });
2182
- }
2192
+ __privateGet(this, _EmitEvent).call(this, "Completed", workerEx, runner.id);
2183
2193
  console.log(chalk$1.green(`ProcessCompleted: [${JSON.stringify(runner)}]`));
2184
2194
  });
2185
2195
  __privateAdd(this, _CreateAsyncRunner, (workerEx, runnerOptions) => {
@@ -2478,6 +2488,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2478
2488
  };
2479
2489
  _SetRunnerIntoWorker = new WeakMap();
2480
2490
  _ProcessTelemetry = new WeakMap();
2491
+ _EmitEvent = new WeakMap();
2481
2492
  _RunnerStateChange = new WeakMap();
2482
2493
  _ProcessCompleted = new WeakMap();
2483
2494
  _CreateAsyncRunner = new WeakMap();