@nsshunt/ststestrunner 1.1.44 → 1.1.45
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/ststestrunner.cjs +38 -46
- package/dist/ststestrunner.cjs.map +1 -1
- package/dist/ststestrunner.mjs +38 -46
- package/dist/ststestrunner.mjs.map +1 -1
- package/package.json +1 -1
- package/types/libmodule/testCase01.d.ts +1 -0
- package/types/libmodule/testCase01.d.ts.map +1 -1
- package/types/libmodule/testCase02.d.ts +2 -2
- package/types/libmodule/testCase02.d.ts.map +1 -1
- package/types/libmodule/testCaseFhir01.d.ts.map +1 -1
- package/types/libmodule/testCaseFhir02.d.ts.map +1 -1
- package/types/libmodule/testCaseFhir06.d.ts.map +1 -1
- package/types/libmodule/testCaseFhirBase.d.ts +1 -0
- package/types/libmodule/testCaseFhirBase.d.ts.map +1 -1
package/dist/ststestrunner.mjs
CHANGED
|
@@ -162,6 +162,10 @@ var TestCaseFhirBase = class {
|
|
|
162
162
|
Debug = (message) => {
|
|
163
163
|
this.#runnerExecutionWorker.logger.debug(message);
|
|
164
164
|
};
|
|
165
|
+
Error = (message) => {
|
|
166
|
+
this.LogErrorMessage(message);
|
|
167
|
+
this.#runnerExecutionWorker.logger.error(message);
|
|
168
|
+
};
|
|
165
169
|
Warning = (message) => {
|
|
166
170
|
this.#runnerExecutionWorker.logger.warn(message);
|
|
167
171
|
};
|
|
@@ -289,7 +293,7 @@ var TestCaseFhirBase = class {
|
|
|
289
293
|
return "";
|
|
290
294
|
}
|
|
291
295
|
} catch (error) {
|
|
292
|
-
|
|
296
|
+
this.Error(error);
|
|
293
297
|
let details = "None available.";
|
|
294
298
|
if (error.response && error.response.data) try {
|
|
295
299
|
details = JSON.stringify(error.response.data);
|
|
@@ -352,7 +356,7 @@ var TestCaseFhirBase = class {
|
|
|
352
356
|
};
|
|
353
357
|
};
|
|
354
358
|
StartTestDataLoad = async () => {
|
|
355
|
-
|
|
359
|
+
this.Debug(chalk.magenta(`StartTestDataLoad(): Start ...`));
|
|
356
360
|
let VU = 0;
|
|
357
361
|
const blockNum = VU * 200;
|
|
358
362
|
const blocksToLoad = 20;
|
|
@@ -364,16 +368,16 @@ var TestCaseFhirBase = class {
|
|
|
364
368
|
if (recordsetData) {
|
|
365
369
|
const qqq = recordsetData[0].text;
|
|
366
370
|
for (let j = 0; j < qqq.length; j++) this.#randomDataRecordset.push(qqq[j]);
|
|
367
|
-
|
|
371
|
+
this.Error(chalk.magenta(this.#randomDataRecordset.length));
|
|
368
372
|
}
|
|
369
|
-
} else
|
|
373
|
+
} else this.Error(chalk.magenta(`StartTestDataLoad(): Could not get person records.`));
|
|
370
374
|
await Sleep(10);
|
|
371
375
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
for (let i = 0; i < 10; i++)
|
|
375
|
-
|
|
376
|
-
|
|
376
|
+
this.Debug(`Finished load for VU: [${VU}]`);
|
|
377
|
+
this.Debug(`First 10 entries`);
|
|
378
|
+
for (let i = 0; i < 10; i++) this.Debug(this.#randomDataRecordset[i].id);
|
|
379
|
+
this.Debug(`block num: [${blockNum}] length: [${this.#randomDataRecordset.length}] VU: [${VU}]`);
|
|
380
|
+
this.Debug(chalk.magenta(`StartTestDataLoad(): End`));
|
|
377
381
|
};
|
|
378
382
|
#ForcePublishTelemetryData = async () => {
|
|
379
383
|
await this.#PublishTelemetryData();
|
|
@@ -417,13 +421,13 @@ var TestCaseFhirBase = class {
|
|
|
417
421
|
StopRunner = async () => {
|
|
418
422
|
await this.#OutputLogMessage(`StopRunner [${this.#runner.id}]`);
|
|
419
423
|
await this.#ForcePublishTelemetryData();
|
|
420
|
-
|
|
424
|
+
this.Debug(`TestCaseFhirBase:StopRunner(): Calling: [#fhirClient.Terminate()]`);
|
|
421
425
|
return true;
|
|
422
426
|
};
|
|
423
427
|
TerminateRunner = async () => {
|
|
424
428
|
await this.#OutputLogMessage(`TerminateRunner [${this.#runner.id}]`);
|
|
425
429
|
await this.#ForcePublishTelemetryData();
|
|
426
|
-
|
|
430
|
+
this.Debug(`TestCaseFhirBase:TerminateRunner(): Calling: [#fhirClient.Terminate()]`);
|
|
427
431
|
return true;
|
|
428
432
|
};
|
|
429
433
|
Completed = async () => {
|
|
@@ -431,7 +435,7 @@ var TestCaseFhirBase = class {
|
|
|
431
435
|
this.runner.instrumentData.timer = performance.now() - start;
|
|
432
436
|
await this.#OutputLogMessage(`Completed [${this.#runner.id}] [${JSON.stringify(this.#runner.instrumentData)}]`);
|
|
433
437
|
await this.#ForcePublishTelemetryData();
|
|
434
|
-
|
|
438
|
+
this.Debug(`TestCaseFhirBase:Completed(): Calling: [#fhirClient.Terminate()]`);
|
|
435
439
|
return true;
|
|
436
440
|
};
|
|
437
441
|
PauseRunner = async () => {
|
|
@@ -1395,14 +1399,9 @@ var TestCase01 = class {
|
|
|
1395
1399
|
this.#runnerExecutionWorker = runnerExecutionWorker;
|
|
1396
1400
|
this.#runner = runner;
|
|
1397
1401
|
}
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
* Currently disabled/commented out to avoid noisy console output during tests.
|
|
1402
|
-
*
|
|
1403
|
-
* @param message Message to output.
|
|
1404
|
-
*/
|
|
1405
|
-
#LogMessage = (message) => {};
|
|
1402
|
+
Debug = (message) => {
|
|
1403
|
+
this.#runnerExecutionWorker.logger.debug(message);
|
|
1404
|
+
};
|
|
1406
1405
|
/**
|
|
1407
1406
|
* Generate an animated indented log message for the runner.
|
|
1408
1407
|
*
|
|
@@ -1429,7 +1428,7 @@ var TestCase01 = class {
|
|
|
1429
1428
|
};
|
|
1430
1429
|
const logMessageData = this.#logMessageDataSet[runner.id];
|
|
1431
1430
|
const message = `${" ".repeat(logMessageData.indent)} [${runner.id}] >> Hello World << ${iteration}`;
|
|
1432
|
-
this
|
|
1431
|
+
this.Debug(message);
|
|
1433
1432
|
runner.instrumentData.message.push(message);
|
|
1434
1433
|
logMessageData.indent += logMessageData.adder;
|
|
1435
1434
|
if (logMessageData.indent > 20) logMessageData.adder = -1;
|
|
@@ -1450,7 +1449,7 @@ var TestCase01 = class {
|
|
|
1450
1449
|
#SetupTimeout = async () => {
|
|
1451
1450
|
if (!this.#publishTelemetryTimeout) {
|
|
1452
1451
|
this.#publishTelemetryTimeout = setTimeout(async () => {
|
|
1453
|
-
this
|
|
1452
|
+
this.Debug(chalk.yellow(` PublishTelemetryData - Normal Behaviour (**** TIMEOUT ****) `));
|
|
1454
1453
|
await this.#PublishTelemetryData();
|
|
1455
1454
|
this.#publishTelemetryCount = 0;
|
|
1456
1455
|
this.#publishTelemetryTimeout = null;
|
|
@@ -1479,7 +1478,7 @@ var TestCase01 = class {
|
|
|
1479
1478
|
*/
|
|
1480
1479
|
#PublishTelemetryData = async () => {
|
|
1481
1480
|
this.#runnerExecutionWorker.PostTelemetryById(this.#runner.id);
|
|
1482
|
-
this
|
|
1481
|
+
this.Debug(chalk.red(`------------------------------------------------------------------------------------------------------------`));
|
|
1483
1482
|
this.#runner.instrumentData.velocity = 0;
|
|
1484
1483
|
this.#runner.instrumentData.message = [];
|
|
1485
1484
|
this.#runner.instrumentData.tx = 0;
|
|
@@ -1499,7 +1498,7 @@ var TestCase01 = class {
|
|
|
1499
1498
|
* - complete
|
|
1500
1499
|
*/
|
|
1501
1500
|
#ForcePublishTelemetryData = async () => {
|
|
1502
|
-
this
|
|
1501
|
+
this.Debug(chalk.magenta(` **** FORCED PUBLISH **** `));
|
|
1503
1502
|
await this.#PublishTelemetryData();
|
|
1504
1503
|
};
|
|
1505
1504
|
/**
|
|
@@ -1520,7 +1519,7 @@ var TestCase01 = class {
|
|
|
1520
1519
|
#PublishTelemetry = async () => {
|
|
1521
1520
|
this.#publishTelemetryCount++;
|
|
1522
1521
|
if (this.#publishTelemetryCount % this.#maxBufferSize === 0) {
|
|
1523
|
-
this
|
|
1522
|
+
this.Debug(chalk.cyan(` **** MAX COUNT REACHED **** `));
|
|
1524
1523
|
this.#publishTelemetryCount = 0;
|
|
1525
1524
|
if (this.#publishTelemetryTimeout) {
|
|
1526
1525
|
clearTimeout(this.#publishTelemetryTimeout);
|
|
@@ -1591,7 +1590,7 @@ var TestCase01 = class {
|
|
|
1591
1590
|
if (this.#runner.instrumentData.requestCount % options.logMessageMod === 0) this.#GenLogMessage(this.#runner, this.#runner.iteration);
|
|
1592
1591
|
if (this.#runner.instrumentData.requestCount % 1 === 0) {
|
|
1593
1592
|
const message = `Worker: [${this.#runner.asyncRunnerContext.threadId}], Runner: [${this.#runner.asyncRunnerContext.id}] has completed: [${this.#runner.instrumentData.requestCount}] iterations of max: [${options.executionProfile.iterations}]`;
|
|
1594
|
-
this
|
|
1593
|
+
this.Debug(message);
|
|
1595
1594
|
this.#runner.instrumentData.message = [message];
|
|
1596
1595
|
}
|
|
1597
1596
|
/**
|
|
@@ -1620,7 +1619,7 @@ var TestCase01 = class {
|
|
|
1620
1619
|
*/
|
|
1621
1620
|
#OutputLogMessage = async (message) => {
|
|
1622
1621
|
const messageOutput = chalk.grey(message);
|
|
1623
|
-
this
|
|
1622
|
+
this.Debug(messageOutput);
|
|
1624
1623
|
this.#runner.instrumentData.message.push(messageOutput);
|
|
1625
1624
|
await this.#PublishTelemetry();
|
|
1626
1625
|
};
|
|
@@ -1807,15 +1806,9 @@ var TestCase02 = class {
|
|
|
1807
1806
|
this.#runnerExecutionWorker = runnerExecutionWorker;
|
|
1808
1807
|
this.#runner = runner;
|
|
1809
1808
|
}
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
* Currently disabled/commented out to avoid noisy console output during normal testing.
|
|
1814
|
-
* The class still uses `console.log(...)` directly in `ExecuteRunner()` for visible progress.
|
|
1815
|
-
*
|
|
1816
|
-
* @param message Message to output.
|
|
1817
|
-
*/
|
|
1818
|
-
#LogMessage = (message) => {};
|
|
1809
|
+
Debug = (message) => {
|
|
1810
|
+
this.#runnerExecutionWorker.logger.debug(message);
|
|
1811
|
+
};
|
|
1819
1812
|
/**
|
|
1820
1813
|
* Generate an animated indented "Hello World" style log message.
|
|
1821
1814
|
*
|
|
@@ -1840,7 +1833,7 @@ var TestCase02 = class {
|
|
|
1840
1833
|
};
|
|
1841
1834
|
const logMessageData = this.#logMessageDataSet[runner.id];
|
|
1842
1835
|
const message = `${" ".repeat(logMessageData.indent)} [${runner.id}] >> Hello World << ${iteration}`;
|
|
1843
|
-
this
|
|
1836
|
+
this.Debug(message);
|
|
1844
1837
|
runner.instrumentData.message.push(message);
|
|
1845
1838
|
logMessageData.indent += logMessageData.adder;
|
|
1846
1839
|
if (logMessageData.indent > 20) logMessageData.adder = -1;
|
|
@@ -1861,7 +1854,7 @@ var TestCase02 = class {
|
|
|
1861
1854
|
#SetupTimeout = async () => {
|
|
1862
1855
|
if (!this.#publishTelemetryTimeout) {
|
|
1863
1856
|
this.#publishTelemetryTimeout = setTimeout(async () => {
|
|
1864
|
-
this
|
|
1857
|
+
this.Debug(chalk.yellow(` PublishTelemetryData - Normal Behaviour (**** TIMEOUT ****) `));
|
|
1865
1858
|
await this.#PublishTelemetryData();
|
|
1866
1859
|
this.#publishTelemetryCount = 0;
|
|
1867
1860
|
this.#publishTelemetryTimeout = null;
|
|
@@ -1886,7 +1879,7 @@ var TestCase02 = class {
|
|
|
1886
1879
|
*/
|
|
1887
1880
|
#PublishTelemetryData = async () => {
|
|
1888
1881
|
this.#runnerExecutionWorker.PostTelemetryById(this.#runner.id);
|
|
1889
|
-
this
|
|
1882
|
+
this.Debug(chalk.red(`------------------------------------------------------------------------------------------------------------`));
|
|
1890
1883
|
this.#runner.instrumentData.velocity = 0;
|
|
1891
1884
|
this.#runner.instrumentData.message = [];
|
|
1892
1885
|
this.#runner.instrumentData.tx = 0;
|
|
@@ -1899,7 +1892,7 @@ var TestCase02 = class {
|
|
|
1899
1892
|
* Used for lifecycle transitions where immediate visibility is desirable.
|
|
1900
1893
|
*/
|
|
1901
1894
|
#ForcePublishTelemetryData = async () => {
|
|
1902
|
-
this
|
|
1895
|
+
this.Debug(chalk.magenta(` **** FORCED PUBLISH **** `));
|
|
1903
1896
|
await this.#PublishTelemetryData();
|
|
1904
1897
|
};
|
|
1905
1898
|
/**
|
|
@@ -1920,7 +1913,7 @@ var TestCase02 = class {
|
|
|
1920
1913
|
#PublishTelemetry = async () => {
|
|
1921
1914
|
this.#publishTelemetryCount++;
|
|
1922
1915
|
if (this.#publishTelemetryCount % this.#maxBufferSize === 0) {
|
|
1923
|
-
this
|
|
1916
|
+
this.Debug(chalk.cyan(` **** MAX COUNT REACHED **** `));
|
|
1924
1917
|
this.#publishTelemetryCount = 0;
|
|
1925
1918
|
if (this.#publishTelemetryTimeout) {
|
|
1926
1919
|
clearTimeout(this.#publishTelemetryTimeout);
|
|
@@ -1952,7 +1945,6 @@ var TestCase02 = class {
|
|
|
1952
1945
|
* - updates runner telemetry
|
|
1953
1946
|
* - optionally generates animated telemetry messages
|
|
1954
1947
|
* - always generates a progress message for telemetry
|
|
1955
|
-
* - always writes a progress message to `console.log(...)`
|
|
1956
1948
|
* - simulates work with either:
|
|
1957
1949
|
* - `Sleep(options.sleepDuration)`, or
|
|
1958
1950
|
* - immediate yield
|
|
@@ -1973,7 +1965,7 @@ var TestCase02 = class {
|
|
|
1973
1965
|
* Additional visible behaviour
|
|
1974
1966
|
* ----------------------------
|
|
1975
1967
|
* Unlike `TestCase01`, this implementation always writes a progress message
|
|
1976
|
-
* directly to the process/browser console using
|
|
1968
|
+
* directly to the process/browser console using the provided logger.
|
|
1977
1969
|
*
|
|
1978
1970
|
* This makes it more useful for manually watching test progress while the
|
|
1979
1971
|
* framework is running.
|
|
@@ -1992,7 +1984,7 @@ var TestCase02 = class {
|
|
|
1992
1984
|
if (this.#runner.instrumentData.requestCount % options.logMessageMod === 0) this.#GenLogMessage(this.#runner, this.#runner.iteration);
|
|
1993
1985
|
if (this.#runner.instrumentData.requestCount % 1 === 0) {
|
|
1994
1986
|
const message = `Worker: [${this.#runner.asyncRunnerContext.threadId}], Runner: [${this.#runner.asyncRunnerContext.id}] has completed: [${this.#runner.instrumentData.requestCount}] iterations of max: [${options.executionProfile.iterations}]`;
|
|
1995
|
-
this
|
|
1987
|
+
this.Debug(message);
|
|
1996
1988
|
this.#runner.instrumentData.message = [message];
|
|
1997
1989
|
}
|
|
1998
1990
|
/**
|
|
@@ -2001,7 +1993,7 @@ var TestCase02 = class {
|
|
|
2001
1993
|
* This is the main behavioural difference from `TestCase01`.
|
|
2002
1994
|
*/
|
|
2003
1995
|
const message = `Worker: [${this.#runner.asyncRunnerContext.threadId}], Runner: [${this.#runner.asyncRunnerContext.id}] has completed: [${this.#runner.instrumentData.requestCount}] iterations of max: [${options.executionProfile.iterations}]`;
|
|
2004
|
-
|
|
1996
|
+
this.Debug(message);
|
|
2005
1997
|
/**
|
|
2006
1998
|
* Simulate actual work.
|
|
2007
1999
|
*
|
|
@@ -2029,7 +2021,7 @@ var TestCase02 = class {
|
|
|
2029
2021
|
*/
|
|
2030
2022
|
#OutputLogMessage = async (message) => {
|
|
2031
2023
|
const messageOutput = chalk.grey(message);
|
|
2032
|
-
this
|
|
2024
|
+
this.Debug(messageOutput);
|
|
2033
2025
|
this.#runner.instrumentData.message.push(messageOutput);
|
|
2034
2026
|
await this.#PublishTelemetry();
|
|
2035
2027
|
};
|