@nsshunt/ststestrunner 1.1.14 → 1.1.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsshunt/ststestrunner",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "description": "STS Test Runner Module",
5
5
  "type": "module",
6
6
  "main": "./dist/ststestrunner.cjs",
@@ -1 +1 @@
1
- {"version":3,"file":"asyncRunnerFactory.d.ts","sourceRoot":"","sources":["../../src/libmodule/asyncRunnerFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAA;AAazH,qBAAa,kBAAkB;IAC3B,MAAM,CAAC,iBAAiB,GAAU,uBAAuB,6BAA6B,EAAE,4BAA4B,2BAA2B,KAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAyBhL;CACJ"}
1
+ {"version":3,"file":"asyncRunnerFactory.d.ts","sourceRoot":"","sources":["../../src/libmodule/asyncRunnerFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAA;AAgBzH,qBAAa,kBAAkB;IAC3B,MAAM,CAAC,iBAAiB,GAAU,uBAAuB,6BAA6B,EAAE,4BAA4B,2BAA2B,KAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CA6BhL;CACJ"}
@@ -0,0 +1,188 @@
1
+ import { AbstractRunnerExecutionWorker, IRunnerInstance, IRunnerOptions, IRunner } from '@nsshunt/stsrunnerframework';
2
+ /**
3
+ * Extended runner options used specifically by `TestCase01`.
4
+ *
5
+ * In addition to standard framework runner options, this test case supports:
6
+ *
7
+ * - `sleepDuration`
8
+ * - `logMessageMod`
9
+ * - `colourIndex`
10
+ *
11
+ * These fields allow the test runner to simulate work and produce predictable
12
+ * telemetry/logging behaviour.
13
+ */
14
+ export interface IRunnerOptionsEx extends IRunnerOptions {
15
+ /**
16
+ * Simulated work delay in milliseconds for each execution iteration.
17
+ *
18
+ * If greater than zero, the runner sleeps for this duration inside `ExecuteRunner()`.
19
+ * If zero, it yields immediately instead.
20
+ */
21
+ sleepDuration: number;
22
+ /**
23
+ * Frequency for generating animated log messages.
24
+ *
25
+ * Example:
26
+ * - if `logMessageMod` is `5`, a generated log message is emitted every 5 requests.
27
+ */
28
+ logMessageMod: number;
29
+ /**
30
+ * Placeholder/example option for colour selection.
31
+ *
32
+ * Currently present for test flexibility but not actively used in the logic shown here.
33
+ */
34
+ colourIndex: number;
35
+ }
36
+ /**
37
+ * Concrete synthetic test runner implementation.
38
+ *
39
+ * This runner:
40
+ * - simulates work
41
+ * - updates telemetry counters
42
+ * - batches telemetry publishing
43
+ * - emits lifecycle log messages
44
+ */
45
+ export declare class TestCase01 implements IRunnerInstance {
46
+ #private;
47
+ /**
48
+ * Construct a new synthetic test runner.
49
+ *
50
+ * @param runnerExecutionWorker Owning worker-side execution host.
51
+ * @param runner Live runner model/state for this test runner.
52
+ */
53
+ constructor(runnerExecutionWorker: AbstractRunnerExecutionWorker, runner: IRunner);
54
+ /**
55
+ * Yield immediately to the event loop/microtask queue.
56
+ *
57
+ * Used when the runner wants to behave asynchronously but does not need
58
+ * a real delay.
59
+ *
60
+ * @returns Resolved promise.
61
+ */
62
+ SleepImmediate(): Promise<void>;
63
+ /**
64
+ * Execute one synthetic unit of work for this runner.
65
+ *
66
+ * Behaviour
67
+ * ---------
68
+ * - captures start time
69
+ * - reads extended runner options
70
+ * - updates telemetry counters/metrics
71
+ * - optionally generates log messages
72
+ * - optionally emits status/progress messages
73
+ * - simulates actual work using:
74
+ * - `Sleep(options.sleepDuration)`, or
75
+ * - immediate yield
76
+ * - decrements active request count
77
+ * - records duration
78
+ * - publishes telemetry using buffered publish logic
79
+ *
80
+ * Telemetry updates performed
81
+ * ---------------------------
82
+ * - `coreCount = 1`
83
+ * - `activeRequestCount++`
84
+ * - `requestCount++`
85
+ * - `velocity++`
86
+ * - `tx += 256000`
87
+ * - `rx += 6500000`
88
+ * - `duration = measured execution time`
89
+ *
90
+ * Notes
91
+ * -----
92
+ * - This method simulates real work rather than performing domain logic
93
+ * - It is intended to validate the framework's runner/telemetry lifecycle
94
+ * - After the awaited work delay, the actual framework runner state may have
95
+ * changed externally, but this test implementation does not directly react here
96
+ *
97
+ * @returns `true` when the synthetic work cycle completes.
98
+ */
99
+ ExecuteRunner: () => Promise<any>;
100
+ /**
101
+ * Handle framework "start" lifecycle event for this runner.
102
+ *
103
+ * Behaviour:
104
+ * - writes a lifecycle message
105
+ * - forces immediate telemetry publication
106
+ *
107
+ * @returns `true`
108
+ */
109
+ StartRunner: () => Promise<any>;
110
+ /**
111
+ * Handle framework "stop" lifecycle event for this runner.
112
+ *
113
+ * Behaviour:
114
+ * - writes a lifecycle message
115
+ * - forces immediate telemetry publication
116
+ *
117
+ * @returns `true`
118
+ */
119
+ StopRunner: () => Promise<any>;
120
+ /**
121
+ * Handle framework "terminate" lifecycle event for this runner.
122
+ *
123
+ * Behaviour:
124
+ * - writes a lifecycle message
125
+ * - forces immediate telemetry publication
126
+ *
127
+ * @returns `true`
128
+ */
129
+ TerminateRunner: () => Promise<any>;
130
+ /**
131
+ * Handle framework "completed" lifecycle event for this runner.
132
+ *
133
+ * Behaviour:
134
+ * - writes a completion lifecycle message including current telemetry snapshot
135
+ * - forces immediate telemetry publication
136
+ *
137
+ * @returns `true`
138
+ */
139
+ Completed: () => Promise<any>;
140
+ /**
141
+ * Handle framework "pause" lifecycle event for this runner.
142
+ *
143
+ * Behaviour:
144
+ * - writes a lifecycle message
145
+ * - forces immediate telemetry publication
146
+ * - returns a descriptive diagnostic string
147
+ *
148
+ * @returns Diagnostic pause message.
149
+ */
150
+ PauseRunner: () => Promise<any>;
151
+ /**
152
+ * Handle framework "resume" lifecycle event for this runner.
153
+ *
154
+ * Behaviour:
155
+ * - writes a lifecycle message
156
+ * - forces immediate telemetry publication
157
+ * - returns a descriptive diagnostic string
158
+ *
159
+ * @returns Diagnostic resume message.
160
+ */
161
+ ResumeRunner: () => Promise<any>;
162
+ /**
163
+ * Handle framework "reset" lifecycle event for this runner.
164
+ *
165
+ * Behaviour:
166
+ * - writes a lifecycle message
167
+ * - resets `requestCount` to zero
168
+ * - forces immediate telemetry publication
169
+ *
170
+ * @returns `true`
171
+ */
172
+ ResetRunner: () => Promise<any>;
173
+ /**
174
+ * Handle framework "update" lifecycle event for this runner.
175
+ *
176
+ * Behaviour:
177
+ * - writes a lifecycle message
178
+ * - forces immediate telemetry publication
179
+ *
180
+ * Note:
181
+ * - this implementation does not directly apply option changes itself;
182
+ * it simply acknowledges the lifecycle event for framework testing
183
+ *
184
+ * @returns `true`
185
+ */
186
+ UpdateRunner: () => Promise<any>;
187
+ }
188
+ //# sourceMappingURL=testCase01.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testCase01.d.ts","sourceRoot":"","sources":["../../src/libmodule/testCase01.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,OAAO,EAAE,6BAA6B,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAyCtH;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACpD;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,qBAAa,UAAW,YAAW,eAAe;;IAqD9C;;;;;OAKG;gBACS,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,EAAE,OAAO;IA0KjF;;;;;;;OAOG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAM/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,aAAa,QAAa,OAAO,CAAC,GAAG,CAAC,CA+CpC;IAeF;;;;;;;;OAQG;IACH,WAAW,QAAa,OAAO,CAAC,GAAG,CAAC,CAIlC;IAEF;;;;;;;;OAQG;IACH,UAAU,QAAa,OAAO,CAAC,GAAG,CAAC,CAIjC;IAEF;;;;;;;;OAQG;IACH,eAAe,QAAa,OAAO,CAAC,GAAG,CAAC,CAItC;IAEF;;;;;;;;OAQG;IACH,SAAS,QAAa,OAAO,CAAC,GAAG,CAAC,CAIhC;IAEF;;;;;;;;;OASG;IACH,WAAW,QAAa,OAAO,CAAC,GAAG,CAAC,CAIlC;IAEF;;;;;;;;;OASG;IACH,YAAY,QAAa,OAAO,CAAC,GAAG,CAAC,CAInC;IAEF;;;;;;;;;OASG;IACH,WAAW,QAAa,OAAO,CAAC,GAAG,CAAC,CAKlC;IAEF;;;;;;;;;;;;OAYG;IACH,YAAY,QAAa,OAAO,CAAC,GAAG,CAAC,CAInC;CACL"}
@@ -0,0 +1,178 @@
1
+ import { AbstractRunnerExecutionWorker, IRunnerInstance, IRunnerOptions, IRunner } from '@nsshunt/stsrunnerframework';
2
+ /**
3
+ * Extended runner options used by `TestCase02`.
4
+ *
5
+ * In addition to the standard runner options, this test runner supports:
6
+ *
7
+ * - `sleepDuration`
8
+ * - `logMessageMod`
9
+ * - `colourIndex`
10
+ */
11
+ export interface IRunnerOptionsEx extends IRunnerOptions {
12
+ /**
13
+ * Simulated work delay in milliseconds for each execution cycle.
14
+ */
15
+ sleepDuration: number;
16
+ /**
17
+ * Frequency used for generated "Hello World" log messages.
18
+ *
19
+ * Example:
20
+ * - if set to `10`, an animated log message is generated every 10 requests.
21
+ */
22
+ logMessageMod: number;
23
+ /**
24
+ * Placeholder/example option for colour selection.
25
+ *
26
+ * Present for testing/extensibility, though not directly used in the logic shown.
27
+ */
28
+ colourIndex: number;
29
+ }
30
+ /**
31
+ * Concrete synthetic test runner implementation.
32
+ *
33
+ * This runner simulates work, updates telemetry, batches telemetry publishing,
34
+ * and writes both internal telemetry messages and visible console progress.
35
+ */
36
+ export declare class TestCase02 implements IRunnerInstance {
37
+ #private;
38
+ /**
39
+ * Construct a new `TestCase02` runner.
40
+ *
41
+ * @param runnerExecutionWorker Owning worker-side execution host.
42
+ * @param runner Live runner model/state.
43
+ */
44
+ constructor(runnerExecutionWorker: AbstractRunnerExecutionWorker, runner: IRunner);
45
+ /**
46
+ * Yield immediately to the event loop/microtask queue.
47
+ *
48
+ * Used when asynchronous behaviour is desired but no real delay is needed.
49
+ *
50
+ * @returns Resolved promise.
51
+ */
52
+ SleepImmediate(): Promise<void>;
53
+ /**
54
+ * Execute one synthetic unit of work for this runner.
55
+ *
56
+ * Behaviour
57
+ * ---------
58
+ * - captures start time
59
+ * - reads extended test options
60
+ * - updates runner telemetry
61
+ * - optionally generates animated telemetry messages
62
+ * - always generates a progress message for telemetry
63
+ * - always writes a progress message to `console.log(...)`
64
+ * - simulates work with either:
65
+ * - `Sleep(options.sleepDuration)`, or
66
+ * - immediate yield
67
+ * - decrements active request count
68
+ * - calculates and stores execution duration
69
+ * - performs buffered telemetry publication
70
+ *
71
+ * Telemetry fields updated
72
+ * ------------------------
73
+ * - `coreCount = 1`
74
+ * - `activeRequestCount++`
75
+ * - `requestCount++`
76
+ * - `velocity++`
77
+ * - `tx += 256000`
78
+ * - `rx += 6500000`
79
+ * - `duration = measured elapsed time`
80
+ *
81
+ * Additional visible behaviour
82
+ * ----------------------------
83
+ * Unlike `TestCase01`, this implementation always writes a progress message
84
+ * directly to the process/browser console using `console.log(...)`.
85
+ *
86
+ * This makes it more useful for manually watching test progress while the
87
+ * framework is running.
88
+ *
89
+ * @returns `true` when the simulated work cycle completes.
90
+ */
91
+ ExecuteRunner: () => Promise<boolean>;
92
+ /**
93
+ * Handle framework "start" lifecycle event.
94
+ *
95
+ * Behaviour:
96
+ * - writes a lifecycle message
97
+ * - forces immediate telemetry publication
98
+ *
99
+ * @returns `true`
100
+ */
101
+ StartRunner: () => Promise<boolean>;
102
+ /**
103
+ * Handle framework "stop" lifecycle event.
104
+ *
105
+ * Behaviour:
106
+ * - writes a lifecycle message
107
+ * - forces immediate telemetry publication
108
+ *
109
+ * @returns `true`
110
+ */
111
+ StopRunner: () => Promise<boolean>;
112
+ /**
113
+ * Handle framework "terminate" lifecycle event.
114
+ *
115
+ * Behaviour:
116
+ * - writes a lifecycle message
117
+ * - forces immediate telemetry publication
118
+ *
119
+ * @returns `true`
120
+ */
121
+ TerminateRunner: () => Promise<boolean>;
122
+ /**
123
+ * Handle framework "completed" lifecycle event.
124
+ *
125
+ * Behaviour:
126
+ * - writes a completion message including the current telemetry snapshot
127
+ * - forces immediate telemetry publication
128
+ *
129
+ * @returns `true`
130
+ */
131
+ Completed: () => Promise<boolean>;
132
+ /**
133
+ * Handle framework "pause" lifecycle event.
134
+ *
135
+ * Behaviour:
136
+ * - writes a lifecycle message
137
+ * - forces immediate telemetry publication
138
+ *
139
+ * @returns `true`
140
+ */
141
+ PauseRunner: () => Promise<boolean>;
142
+ /**
143
+ * Handle framework "resume" lifecycle event.
144
+ *
145
+ * Behaviour:
146
+ * - writes a lifecycle message
147
+ * - forces immediate telemetry publication
148
+ *
149
+ * @returns `true`
150
+ */
151
+ ResumeRunner: () => Promise<boolean>;
152
+ /**
153
+ * Handle framework "reset" lifecycle event.
154
+ *
155
+ * Behaviour:
156
+ * - writes a lifecycle message
157
+ * - resets `requestCount` to zero
158
+ * - forces immediate telemetry publication
159
+ *
160
+ * @returns `true`
161
+ */
162
+ ResetRunner: () => Promise<boolean>;
163
+ /**
164
+ * Handle framework "update" lifecycle event.
165
+ *
166
+ * Behaviour:
167
+ * - writes a lifecycle message
168
+ * - forces immediate telemetry publication
169
+ *
170
+ * Note:
171
+ * - this implementation acknowledges the update event but does not apply
172
+ * custom update logic itself
173
+ *
174
+ * @returns `true`
175
+ */
176
+ UpdateRunner: () => Promise<boolean>;
177
+ }
178
+ //# sourceMappingURL=testCase02.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testCase02.d.ts","sourceRoot":"","sources":["../../src/libmodule/testCase02.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAE,6BAA6B,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAwCtH;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACpD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,qBAAa,UAAW,YAAW,eAAe;;IAmD9C;;;;;OAKG;gBACS,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,EAAE,OAAO;IA8JjF;;;;;;OAMG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAM/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,aAAa,QAAa,OAAO,CAAC,OAAO,CAAC,CAyDxC;IAeF;;;;;;;;OAQG;IACH,WAAW,QAAa,OAAO,CAAC,OAAO,CAAC,CAItC;IAEF;;;;;;;;OAQG;IACH,UAAU,QAAa,OAAO,CAAC,OAAO,CAAC,CAIrC;IAEF;;;;;;;;OAQG;IACH,eAAe,QAAa,OAAO,CAAC,OAAO,CAAC,CAI1C;IAEF;;;;;;;;OAQG;IACH,SAAS,QAAa,OAAO,CAAC,OAAO,CAAC,CAIpC;IAEF;;;;;;;;OAQG;IACH,WAAW,QAAa,OAAO,CAAC,OAAO,CAAC,CAItC;IAEF;;;;;;;;OAQG;IACH,YAAY,QAAa,OAAO,CAAC,OAAO,CAAC,CAIvC;IAEF;;;;;;;;;OASG;IACH,WAAW,QAAa,OAAO,CAAC,OAAO,CAAC,CAKtC;IAEF;;;;;;;;;;;;OAYG;IACH,YAAY,QAAa,OAAO,CAAC,OAAO,CAAC,CAIvC;CACL"}