@nsshunt/ststestrunner 1.1.43 → 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 +4 -4
- 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/types/libmodule/workerFhirTestCases.d.ts.map +1 -1
package/dist/ststestrunner.cjs
CHANGED
|
@@ -185,6 +185,10 @@ var TestCaseFhirBase = class {
|
|
|
185
185
|
Debug = (message) => {
|
|
186
186
|
this.#runnerExecutionWorker.logger.debug(message);
|
|
187
187
|
};
|
|
188
|
+
Error = (message) => {
|
|
189
|
+
this.LogErrorMessage(message);
|
|
190
|
+
this.#runnerExecutionWorker.logger.error(message);
|
|
191
|
+
};
|
|
188
192
|
Warning = (message) => {
|
|
189
193
|
this.#runnerExecutionWorker.logger.warn(message);
|
|
190
194
|
};
|
|
@@ -312,7 +316,7 @@ var TestCaseFhirBase = class {
|
|
|
312
316
|
return "";
|
|
313
317
|
}
|
|
314
318
|
} catch (error) {
|
|
315
|
-
|
|
319
|
+
this.Error(error);
|
|
316
320
|
let details = "None available.";
|
|
317
321
|
if (error.response && error.response.data) try {
|
|
318
322
|
details = JSON.stringify(error.response.data);
|
|
@@ -375,7 +379,7 @@ var TestCaseFhirBase = class {
|
|
|
375
379
|
};
|
|
376
380
|
};
|
|
377
381
|
StartTestDataLoad = async () => {
|
|
378
|
-
|
|
382
|
+
this.Debug(chalk.default.magenta(`StartTestDataLoad(): Start ...`));
|
|
379
383
|
let VU = 0;
|
|
380
384
|
const blockNum = VU * 200;
|
|
381
385
|
const blocksToLoad = 20;
|
|
@@ -387,16 +391,16 @@ var TestCaseFhirBase = class {
|
|
|
387
391
|
if (recordsetData) {
|
|
388
392
|
const qqq = recordsetData[0].text;
|
|
389
393
|
for (let j = 0; j < qqq.length; j++) this.#randomDataRecordset.push(qqq[j]);
|
|
390
|
-
|
|
394
|
+
this.Error(chalk.default.magenta(this.#randomDataRecordset.length));
|
|
391
395
|
}
|
|
392
|
-
} else
|
|
396
|
+
} else this.Error(chalk.default.magenta(`StartTestDataLoad(): Could not get person records.`));
|
|
393
397
|
await (0, _nsshunt_stsutils.Sleep)(10);
|
|
394
398
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
for (let i = 0; i < 10; i++)
|
|
398
|
-
|
|
399
|
-
|
|
399
|
+
this.Debug(`Finished load for VU: [${VU}]`);
|
|
400
|
+
this.Debug(`First 10 entries`);
|
|
401
|
+
for (let i = 0; i < 10; i++) this.Debug(this.#randomDataRecordset[i].id);
|
|
402
|
+
this.Debug(`block num: [${blockNum}] length: [${this.#randomDataRecordset.length}] VU: [${VU}]`);
|
|
403
|
+
this.Debug(chalk.default.magenta(`StartTestDataLoad(): End`));
|
|
400
404
|
};
|
|
401
405
|
#ForcePublishTelemetryData = async () => {
|
|
402
406
|
await this.#PublishTelemetryData();
|
|
@@ -440,13 +444,13 @@ var TestCaseFhirBase = class {
|
|
|
440
444
|
StopRunner = async () => {
|
|
441
445
|
await this.#OutputLogMessage(`StopRunner [${this.#runner.id}]`);
|
|
442
446
|
await this.#ForcePublishTelemetryData();
|
|
443
|
-
|
|
447
|
+
this.Debug(`TestCaseFhirBase:StopRunner(): Calling: [#fhirClient.Terminate()]`);
|
|
444
448
|
return true;
|
|
445
449
|
};
|
|
446
450
|
TerminateRunner = async () => {
|
|
447
451
|
await this.#OutputLogMessage(`TerminateRunner [${this.#runner.id}]`);
|
|
448
452
|
await this.#ForcePublishTelemetryData();
|
|
449
|
-
|
|
453
|
+
this.Debug(`TestCaseFhirBase:TerminateRunner(): Calling: [#fhirClient.Terminate()]`);
|
|
450
454
|
return true;
|
|
451
455
|
};
|
|
452
456
|
Completed = async () => {
|
|
@@ -454,7 +458,7 @@ var TestCaseFhirBase = class {
|
|
|
454
458
|
this.runner.instrumentData.timer = performance.now() - start;
|
|
455
459
|
await this.#OutputLogMessage(`Completed [${this.#runner.id}] [${JSON.stringify(this.#runner.instrumentData)}]`);
|
|
456
460
|
await this.#ForcePublishTelemetryData();
|
|
457
|
-
|
|
461
|
+
this.Debug(`TestCaseFhirBase:Completed(): Calling: [#fhirClient.Terminate()]`);
|
|
458
462
|
return true;
|
|
459
463
|
};
|
|
460
464
|
PauseRunner = async () => {
|
|
@@ -1418,14 +1422,9 @@ var TestCase01 = class {
|
|
|
1418
1422
|
this.#runnerExecutionWorker = runnerExecutionWorker;
|
|
1419
1423
|
this.#runner = runner;
|
|
1420
1424
|
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
* Currently disabled/commented out to avoid noisy console output during tests.
|
|
1425
|
-
*
|
|
1426
|
-
* @param message Message to output.
|
|
1427
|
-
*/
|
|
1428
|
-
#LogMessage = (message) => {};
|
|
1425
|
+
Debug = (message) => {
|
|
1426
|
+
this.#runnerExecutionWorker.logger.debug(message);
|
|
1427
|
+
};
|
|
1429
1428
|
/**
|
|
1430
1429
|
* Generate an animated indented log message for the runner.
|
|
1431
1430
|
*
|
|
@@ -1452,7 +1451,7 @@ var TestCase01 = class {
|
|
|
1452
1451
|
};
|
|
1453
1452
|
const logMessageData = this.#logMessageDataSet[runner.id];
|
|
1454
1453
|
const message = `${" ".repeat(logMessageData.indent)} [${runner.id}] >> Hello World << ${iteration}`;
|
|
1455
|
-
this
|
|
1454
|
+
this.Debug(message);
|
|
1456
1455
|
runner.instrumentData.message.push(message);
|
|
1457
1456
|
logMessageData.indent += logMessageData.adder;
|
|
1458
1457
|
if (logMessageData.indent > 20) logMessageData.adder = -1;
|
|
@@ -1473,7 +1472,7 @@ var TestCase01 = class {
|
|
|
1473
1472
|
#SetupTimeout = async () => {
|
|
1474
1473
|
if (!this.#publishTelemetryTimeout) {
|
|
1475
1474
|
this.#publishTelemetryTimeout = setTimeout(async () => {
|
|
1476
|
-
this
|
|
1475
|
+
this.Debug(chalk.default.yellow(` PublishTelemetryData - Normal Behaviour (**** TIMEOUT ****) `));
|
|
1477
1476
|
await this.#PublishTelemetryData();
|
|
1478
1477
|
this.#publishTelemetryCount = 0;
|
|
1479
1478
|
this.#publishTelemetryTimeout = null;
|
|
@@ -1502,7 +1501,7 @@ var TestCase01 = class {
|
|
|
1502
1501
|
*/
|
|
1503
1502
|
#PublishTelemetryData = async () => {
|
|
1504
1503
|
this.#runnerExecutionWorker.PostTelemetryById(this.#runner.id);
|
|
1505
|
-
this
|
|
1504
|
+
this.Debug(chalk.default.red(`------------------------------------------------------------------------------------------------------------`));
|
|
1506
1505
|
this.#runner.instrumentData.velocity = 0;
|
|
1507
1506
|
this.#runner.instrumentData.message = [];
|
|
1508
1507
|
this.#runner.instrumentData.tx = 0;
|
|
@@ -1522,7 +1521,7 @@ var TestCase01 = class {
|
|
|
1522
1521
|
* - complete
|
|
1523
1522
|
*/
|
|
1524
1523
|
#ForcePublishTelemetryData = async () => {
|
|
1525
|
-
this
|
|
1524
|
+
this.Debug(chalk.default.magenta(` **** FORCED PUBLISH **** `));
|
|
1526
1525
|
await this.#PublishTelemetryData();
|
|
1527
1526
|
};
|
|
1528
1527
|
/**
|
|
@@ -1543,7 +1542,7 @@ var TestCase01 = class {
|
|
|
1543
1542
|
#PublishTelemetry = async () => {
|
|
1544
1543
|
this.#publishTelemetryCount++;
|
|
1545
1544
|
if (this.#publishTelemetryCount % this.#maxBufferSize === 0) {
|
|
1546
|
-
this
|
|
1545
|
+
this.Debug(chalk.default.cyan(` **** MAX COUNT REACHED **** `));
|
|
1547
1546
|
this.#publishTelemetryCount = 0;
|
|
1548
1547
|
if (this.#publishTelemetryTimeout) {
|
|
1549
1548
|
clearTimeout(this.#publishTelemetryTimeout);
|
|
@@ -1614,7 +1613,7 @@ var TestCase01 = class {
|
|
|
1614
1613
|
if (this.#runner.instrumentData.requestCount % options.logMessageMod === 0) this.#GenLogMessage(this.#runner, this.#runner.iteration);
|
|
1615
1614
|
if (this.#runner.instrumentData.requestCount % 1 === 0) {
|
|
1616
1615
|
const message = `Worker: [${this.#runner.asyncRunnerContext.threadId}], Runner: [${this.#runner.asyncRunnerContext.id}] has completed: [${this.#runner.instrumentData.requestCount}] iterations of max: [${options.executionProfile.iterations}]`;
|
|
1617
|
-
this
|
|
1616
|
+
this.Debug(message);
|
|
1618
1617
|
this.#runner.instrumentData.message = [message];
|
|
1619
1618
|
}
|
|
1620
1619
|
/**
|
|
@@ -1643,7 +1642,7 @@ var TestCase01 = class {
|
|
|
1643
1642
|
*/
|
|
1644
1643
|
#OutputLogMessage = async (message) => {
|
|
1645
1644
|
const messageOutput = chalk.default.grey(message);
|
|
1646
|
-
this
|
|
1645
|
+
this.Debug(messageOutput);
|
|
1647
1646
|
this.#runner.instrumentData.message.push(messageOutput);
|
|
1648
1647
|
await this.#PublishTelemetry();
|
|
1649
1648
|
};
|
|
@@ -1830,15 +1829,9 @@ var TestCase02 = class {
|
|
|
1830
1829
|
this.#runnerExecutionWorker = runnerExecutionWorker;
|
|
1831
1830
|
this.#runner = runner;
|
|
1832
1831
|
}
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
* Currently disabled/commented out to avoid noisy console output during normal testing.
|
|
1837
|
-
* The class still uses `console.log(...)` directly in `ExecuteRunner()` for visible progress.
|
|
1838
|
-
*
|
|
1839
|
-
* @param message Message to output.
|
|
1840
|
-
*/
|
|
1841
|
-
#LogMessage = (message) => {};
|
|
1832
|
+
Debug = (message) => {
|
|
1833
|
+
this.#runnerExecutionWorker.logger.debug(message);
|
|
1834
|
+
};
|
|
1842
1835
|
/**
|
|
1843
1836
|
* Generate an animated indented "Hello World" style log message.
|
|
1844
1837
|
*
|
|
@@ -1863,7 +1856,7 @@ var TestCase02 = class {
|
|
|
1863
1856
|
};
|
|
1864
1857
|
const logMessageData = this.#logMessageDataSet[runner.id];
|
|
1865
1858
|
const message = `${" ".repeat(logMessageData.indent)} [${runner.id}] >> Hello World << ${iteration}`;
|
|
1866
|
-
this
|
|
1859
|
+
this.Debug(message);
|
|
1867
1860
|
runner.instrumentData.message.push(message);
|
|
1868
1861
|
logMessageData.indent += logMessageData.adder;
|
|
1869
1862
|
if (logMessageData.indent > 20) logMessageData.adder = -1;
|
|
@@ -1884,7 +1877,7 @@ var TestCase02 = class {
|
|
|
1884
1877
|
#SetupTimeout = async () => {
|
|
1885
1878
|
if (!this.#publishTelemetryTimeout) {
|
|
1886
1879
|
this.#publishTelemetryTimeout = setTimeout(async () => {
|
|
1887
|
-
this
|
|
1880
|
+
this.Debug(chalk.default.yellow(` PublishTelemetryData - Normal Behaviour (**** TIMEOUT ****) `));
|
|
1888
1881
|
await this.#PublishTelemetryData();
|
|
1889
1882
|
this.#publishTelemetryCount = 0;
|
|
1890
1883
|
this.#publishTelemetryTimeout = null;
|
|
@@ -1909,7 +1902,7 @@ var TestCase02 = class {
|
|
|
1909
1902
|
*/
|
|
1910
1903
|
#PublishTelemetryData = async () => {
|
|
1911
1904
|
this.#runnerExecutionWorker.PostTelemetryById(this.#runner.id);
|
|
1912
|
-
this
|
|
1905
|
+
this.Debug(chalk.default.red(`------------------------------------------------------------------------------------------------------------`));
|
|
1913
1906
|
this.#runner.instrumentData.velocity = 0;
|
|
1914
1907
|
this.#runner.instrumentData.message = [];
|
|
1915
1908
|
this.#runner.instrumentData.tx = 0;
|
|
@@ -1922,7 +1915,7 @@ var TestCase02 = class {
|
|
|
1922
1915
|
* Used for lifecycle transitions where immediate visibility is desirable.
|
|
1923
1916
|
*/
|
|
1924
1917
|
#ForcePublishTelemetryData = async () => {
|
|
1925
|
-
this
|
|
1918
|
+
this.Debug(chalk.default.magenta(` **** FORCED PUBLISH **** `));
|
|
1926
1919
|
await this.#PublishTelemetryData();
|
|
1927
1920
|
};
|
|
1928
1921
|
/**
|
|
@@ -1943,7 +1936,7 @@ var TestCase02 = class {
|
|
|
1943
1936
|
#PublishTelemetry = async () => {
|
|
1944
1937
|
this.#publishTelemetryCount++;
|
|
1945
1938
|
if (this.#publishTelemetryCount % this.#maxBufferSize === 0) {
|
|
1946
|
-
this
|
|
1939
|
+
this.Debug(chalk.default.cyan(` **** MAX COUNT REACHED **** `));
|
|
1947
1940
|
this.#publishTelemetryCount = 0;
|
|
1948
1941
|
if (this.#publishTelemetryTimeout) {
|
|
1949
1942
|
clearTimeout(this.#publishTelemetryTimeout);
|
|
@@ -1975,7 +1968,6 @@ var TestCase02 = class {
|
|
|
1975
1968
|
* - updates runner telemetry
|
|
1976
1969
|
* - optionally generates animated telemetry messages
|
|
1977
1970
|
* - always generates a progress message for telemetry
|
|
1978
|
-
* - always writes a progress message to `console.log(...)`
|
|
1979
1971
|
* - simulates work with either:
|
|
1980
1972
|
* - `Sleep(options.sleepDuration)`, or
|
|
1981
1973
|
* - immediate yield
|
|
@@ -1996,7 +1988,7 @@ var TestCase02 = class {
|
|
|
1996
1988
|
* Additional visible behaviour
|
|
1997
1989
|
* ----------------------------
|
|
1998
1990
|
* Unlike `TestCase01`, this implementation always writes a progress message
|
|
1999
|
-
* directly to the process/browser console using
|
|
1991
|
+
* directly to the process/browser console using the provided logger.
|
|
2000
1992
|
*
|
|
2001
1993
|
* This makes it more useful for manually watching test progress while the
|
|
2002
1994
|
* framework is running.
|
|
@@ -2015,7 +2007,7 @@ var TestCase02 = class {
|
|
|
2015
2007
|
if (this.#runner.instrumentData.requestCount % options.logMessageMod === 0) this.#GenLogMessage(this.#runner, this.#runner.iteration);
|
|
2016
2008
|
if (this.#runner.instrumentData.requestCount % 1 === 0) {
|
|
2017
2009
|
const message = `Worker: [${this.#runner.asyncRunnerContext.threadId}], Runner: [${this.#runner.asyncRunnerContext.id}] has completed: [${this.#runner.instrumentData.requestCount}] iterations of max: [${options.executionProfile.iterations}]`;
|
|
2018
|
-
this
|
|
2010
|
+
this.Debug(message);
|
|
2019
2011
|
this.#runner.instrumentData.message = [message];
|
|
2020
2012
|
}
|
|
2021
2013
|
/**
|
|
@@ -2024,7 +2016,7 @@ var TestCase02 = class {
|
|
|
2024
2016
|
* This is the main behavioural difference from `TestCase01`.
|
|
2025
2017
|
*/
|
|
2026
2018
|
const message = `Worker: [${this.#runner.asyncRunnerContext.threadId}], Runner: [${this.#runner.asyncRunnerContext.id}] has completed: [${this.#runner.instrumentData.requestCount}] iterations of max: [${options.executionProfile.iterations}]`;
|
|
2027
|
-
|
|
2019
|
+
this.Debug(message);
|
|
2028
2020
|
/**
|
|
2029
2021
|
* Simulate actual work.
|
|
2030
2022
|
*
|
|
@@ -2052,7 +2044,7 @@ var TestCase02 = class {
|
|
|
2052
2044
|
*/
|
|
2053
2045
|
#OutputLogMessage = async (message) => {
|
|
2054
2046
|
const messageOutput = chalk.default.grey(message);
|
|
2055
|
-
this
|
|
2047
|
+
this.Debug(messageOutput);
|
|
2056
2048
|
this.#runner.instrumentData.message.push(messageOutput);
|
|
2057
2049
|
await this.#PublishTelemetry();
|
|
2058
2050
|
};
|