@nsshunt/stsrunnerframework 1.0.60 → 1.0.61
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/README.md +34 -1
- package/dist/stsrunnerframework.mjs +12 -37
- package/dist/stsrunnerframework.mjs.map +1 -1
- package/dist/stsrunnerframework.umd.js +12 -37
- package/dist/stsrunnerframework.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/commonTypes.d.ts +5 -16
- package/types/commonTypes.d.ts.map +1 -1
- package/types/workerInstance.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
# stsrunnerframework
|
|
1
|
+
# stsrunnerframework
|
|
2
|
+
|
|
3
|
+
terminated - this means the process has been terminated and no end-of-process steps should execute such as reports etc.
|
|
4
|
+
|
|
5
|
+
stopped - end the test and report as if completed normnally
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
```mermaid
|
|
9
|
+
---
|
|
10
|
+
config:
|
|
11
|
+
theme: neo
|
|
12
|
+
look: neo
|
|
13
|
+
title: STSRunnerFramework
|
|
14
|
+
---
|
|
15
|
+
stateDiagram
|
|
16
|
+
direction TB
|
|
17
|
+
[*] --> Created:Select Start
|
|
18
|
+
Created --> Running
|
|
19
|
+
Created --> Error:Error Caught
|
|
20
|
+
Running --> Completed:Iterations Exhausted
|
|
21
|
+
Running --> Error:Error Caught
|
|
22
|
+
Running --> Stopped:Select Stop
|
|
23
|
+
Completed --> [*]
|
|
24
|
+
Running --> Paused:Select Pause
|
|
25
|
+
Paused --> Running:Select Resume
|
|
26
|
+
Paused --> Paused:Select Execute or Reset
|
|
27
|
+
Paused --> Stopped:Select Stop
|
|
28
|
+
Running --> Terminated:Select Terminate
|
|
29
|
+
Paused --> Terminated:Select Terminate
|
|
30
|
+
Paused --> Completed:Select Execute<br>Iterations Exhausted
|
|
31
|
+
Terminated --> [*]
|
|
32
|
+
Error --> [*]
|
|
33
|
+
Stopped --> [*]
|
|
34
|
+
```
|
|
@@ -47,24 +47,13 @@ var eIWMessageCommands = /* @__PURE__ */ ((eIWMessageCommands2) => {
|
|
|
47
47
|
return eIWMessageCommands2;
|
|
48
48
|
})(eIWMessageCommands || {});
|
|
49
49
|
var IRunnerState = /* @__PURE__ */ ((IRunnerState2) => {
|
|
50
|
-
IRunnerState2["
|
|
51
|
-
IRunnerState2["
|
|
52
|
-
IRunnerState2["
|
|
50
|
+
IRunnerState2["created"] = "created";
|
|
51
|
+
IRunnerState2["running"] = "running";
|
|
52
|
+
IRunnerState2["paused"] = "paused";
|
|
53
|
+
IRunnerState2["completed"] = "completed";
|
|
53
54
|
IRunnerState2["stopped"] = "stopped";
|
|
54
|
-
IRunnerState2["terminating"] = "terminating";
|
|
55
55
|
IRunnerState2["terminated"] = "terminated";
|
|
56
|
-
IRunnerState2["resuming"] = "resuming";
|
|
57
|
-
IRunnerState2["resumed"] = "resumed";
|
|
58
|
-
IRunnerState2["pausing"] = "pausing";
|
|
59
|
-
IRunnerState2["paused"] = "paused";
|
|
60
|
-
IRunnerState2["executing"] = "executing";
|
|
61
|
-
IRunnerState2["executed"] = "executed";
|
|
62
|
-
IRunnerState2["resetting"] = "resetting";
|
|
63
|
-
IRunnerState2["reset"] = "reset";
|
|
64
56
|
IRunnerState2["error"] = "error";
|
|
65
|
-
IRunnerState2["completed"] = "completed";
|
|
66
|
-
IRunnerState2["created"] = "created";
|
|
67
|
-
IRunnerState2["running"] = "running";
|
|
68
57
|
return IRunnerState2;
|
|
69
58
|
})(IRunnerState || {});
|
|
70
59
|
var IWorkerState = /* @__PURE__ */ ((IWorkerState2) => {
|
|
@@ -1628,7 +1617,7 @@ class WorkerInstance {
|
|
|
1628
1617
|
});
|
|
1629
1618
|
__privateAdd(this, _CanExecuteNextIterationById, (id) => {
|
|
1630
1619
|
const state = __privateGet(this, _runners)[id].runner.state;
|
|
1631
|
-
if (state === IRunnerState.running
|
|
1620
|
+
if (state === IRunnerState.running) {
|
|
1632
1621
|
return true;
|
|
1633
1622
|
}
|
|
1634
1623
|
return false;
|
|
@@ -1680,10 +1669,8 @@ class WorkerInstance {
|
|
|
1680
1669
|
__privateAdd(this, _StartRunner, async (testRunnerTelemetryPayload) => {
|
|
1681
1670
|
const runnerId = testRunnerTelemetryPayload.runner.id;
|
|
1682
1671
|
__privateGet(this, _debug).call(this, `${chalk$1.magenta(`runner: [${runnerId}]`)} StartRunner`);
|
|
1683
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.starting);
|
|
1684
|
-
await Sleep(0);
|
|
1685
1672
|
await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).StartRunner();
|
|
1686
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.
|
|
1673
|
+
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.running);
|
|
1687
1674
|
const ExecuteLoop = async () => {
|
|
1688
1675
|
if (__privateGet(this, _GetRunnerIterationById).call(this, runnerId) < __privateGet(this, _GetRunnerExecutionProfileById).call(this, runnerId).iterations) {
|
|
1689
1676
|
if (__privateGet(this, _CanExecuteNextIterationById).call(this, runnerId)) {
|
|
@@ -1711,8 +1698,6 @@ class WorkerInstance {
|
|
|
1711
1698
|
});
|
|
1712
1699
|
__privateAdd(this, _StopRunnerByRunnerById, async (id) => {
|
|
1713
1700
|
__privateGet(this, _debug).call(this, `${chalk$1.magenta(`runner: [${id}]`)} StopRunner`);
|
|
1714
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, id, IRunnerState.stopping);
|
|
1715
|
-
await Sleep(0);
|
|
1716
1701
|
await __privateGet(this, _GetRunnerInstanceById).call(this, id).StopRunner();
|
|
1717
1702
|
__privateGet(this, _UpdateRunnerStateById).call(this, id, IRunnerState.stopped);
|
|
1718
1703
|
await Sleep(0);
|
|
@@ -1732,8 +1717,6 @@ class WorkerInstance {
|
|
|
1732
1717
|
__privateAdd(this, _TerminateRunner, async (testRunnerTelemetryPayload) => {
|
|
1733
1718
|
const runnerId = testRunnerTelemetryPayload.runner.id;
|
|
1734
1719
|
__privateGet(this, _debug).call(this, `${chalk$1.magenta(`runner: [${runnerId}]`)} TerminateRunner`);
|
|
1735
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.terminating);
|
|
1736
|
-
await Sleep(0);
|
|
1737
1720
|
const retVal = await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).TerminateRunner();
|
|
1738
1721
|
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.terminated);
|
|
1739
1722
|
__privateGet(this, _debug).call(this, `${chalk$1.magenta(`runner: [${runnerId}]`)} TerminateRunner Result = [${retVal}]`);
|
|
@@ -1742,8 +1725,6 @@ class WorkerInstance {
|
|
|
1742
1725
|
__privateAdd(this, _PauseRunner, async (testRunnerTelemetryPayload) => {
|
|
1743
1726
|
const runnerId = testRunnerTelemetryPayload.runner.id;
|
|
1744
1727
|
__privateGet(this, _debug).call(this, `${chalk$1.magenta(`runner: [${runnerId}]`)} PauseRunner`);
|
|
1745
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.pausing);
|
|
1746
|
-
await Sleep(0);
|
|
1747
1728
|
await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).PauseRunner();
|
|
1748
1729
|
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
|
|
1749
1730
|
await Sleep(0);
|
|
@@ -1751,31 +1732,25 @@ class WorkerInstance {
|
|
|
1751
1732
|
__privateAdd(this, _ResumeRunner, async (testRunnerTelemetryPayload) => {
|
|
1752
1733
|
const runnerId = testRunnerTelemetryPayload.runner.id;
|
|
1753
1734
|
__privateGet(this, _debug).call(this, `${chalk$1.magenta(`runner: [${runnerId}]`)} ResumeRunner`);
|
|
1754
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.resuming);
|
|
1755
|
-
await Sleep(0);
|
|
1756
1735
|
await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).ResumeRunner();
|
|
1757
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.
|
|
1736
|
+
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.running);
|
|
1758
1737
|
await Sleep(0);
|
|
1759
1738
|
});
|
|
1760
1739
|
__privateAdd(this, _ResetRunner, async (testRunnerTelemetryPayload) => {
|
|
1761
1740
|
const runnerId = testRunnerTelemetryPayload.runner.id;
|
|
1762
1741
|
__privateGet(this, _debug).call(this, `${chalk$1.magenta(`runner: [${runnerId}]`)} ResetRunner`);
|
|
1763
1742
|
__privateGet(this, _ResetRunnerIterationById).call(this, runnerId);
|
|
1764
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.resetting);
|
|
1765
|
-
await Sleep(0);
|
|
1766
1743
|
await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).ResetRunner();
|
|
1767
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.
|
|
1744
|
+
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
|
|
1768
1745
|
await Sleep(0);
|
|
1769
1746
|
});
|
|
1770
1747
|
// Execute a single iteration of this runners work item
|
|
1771
1748
|
__privateAdd(this, _ExecuteRunner, async (testRunnerTelemetryPayload) => {
|
|
1772
1749
|
const runnerId = testRunnerTelemetryPayload.runner.id;
|
|
1773
1750
|
__privateGet(this, _debug).call(this, `${chalk$1.magenta(`runner: [${runnerId}]`)} ExecuteRunner`);
|
|
1774
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.executing);
|
|
1775
|
-
await Sleep(0);
|
|
1776
1751
|
await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).Execute(__privateGet(this, _GetRunnerIterationById).call(this, runnerId));
|
|
1777
1752
|
__privateGet(this, _IncRunnerIterationById).call(this, runnerId);
|
|
1778
|
-
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.
|
|
1753
|
+
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
|
|
1779
1754
|
await Sleep(0);
|
|
1780
1755
|
});
|
|
1781
1756
|
__privateAdd(this, _UpdateOptions, async (testRunnerTelemetryPayload) => {
|
|
@@ -2298,21 +2273,21 @@ class STSWorkerManager {
|
|
|
2298
2273
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ResetRunner, {
|
|
2299
2274
|
runner: __privateMethod(this, _STSWorkerManager_instances, CreateRunnerCopy_fn).call(this, runnerEx)
|
|
2300
2275
|
});
|
|
2301
|
-
runnerEx.state = IRunnerState.
|
|
2276
|
+
runnerEx.state = IRunnerState.paused;
|
|
2302
2277
|
return true;
|
|
2303
2278
|
});
|
|
2304
2279
|
__privateAdd(this, _ExecuteRunner2, async (workerEx, runnerEx) => {
|
|
2305
2280
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ExecuteRunner, {
|
|
2306
2281
|
runner: __privateMethod(this, _STSWorkerManager_instances, CreateRunnerCopy_fn).call(this, runnerEx)
|
|
2307
2282
|
});
|
|
2308
|
-
runnerEx.state = IRunnerState.
|
|
2283
|
+
runnerEx.state = IRunnerState.paused;
|
|
2309
2284
|
return true;
|
|
2310
2285
|
});
|
|
2311
2286
|
__privateAdd(this, _StopRunner2, async (workerEx, runnerEx) => {
|
|
2312
2287
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.StopRunner, {
|
|
2313
2288
|
runner: __privateMethod(this, _STSWorkerManager_instances, CreateRunnerCopy_fn).call(this, runnerEx)
|
|
2314
2289
|
});
|
|
2315
|
-
runnerEx.state = IRunnerState.
|
|
2290
|
+
runnerEx.state = IRunnerState.terminated;
|
|
2316
2291
|
return true;
|
|
2317
2292
|
});
|
|
2318
2293
|
__privateAdd(this, _TerminateRunner2, async (workerEx, runnerEx = null) => {
|