@nsshunt/ststestrunner 1.1.60 → 1.1.62
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 +14 -35
- package/dist/ststestrunner.cjs.map +1 -1
- package/dist/ststestrunner.mjs +14 -35
- package/dist/ststestrunner.mjs.map +1 -1
- package/package.json +1 -1
- package/types/libmodule/testCaseFhirBase.d.ts +0 -1
- package/types/libmodule/testCaseFhirBase.d.ts.map +1 -1
- package/types/libmodule/workerFhirTestCases.d.ts +3 -1
- package/types/libmodule/workerFhirTestCases.d.ts.map +1 -1
package/dist/ststestrunner.mjs
CHANGED
|
@@ -33,7 +33,6 @@ var TestCaseFhirBase = class {
|
|
|
33
33
|
#authAgentManager;
|
|
34
34
|
accessTokenTime = performance.now();
|
|
35
35
|
newTokenLimitTime = 30;
|
|
36
|
-
fhirClient = null;
|
|
37
36
|
restFhirClient = null;
|
|
38
37
|
defaultAgentOptions = {
|
|
39
38
|
keepAlive: true,
|
|
@@ -132,10 +131,8 @@ var TestCaseFhirBase = class {
|
|
|
132
131
|
GetFhirSocketClient = async () => {
|
|
133
132
|
try {
|
|
134
133
|
this.#clientSocketFetchCount++;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return this.fhirClient;
|
|
138
|
-
}
|
|
134
|
+
let fhirClient = this.runnerExecutionWorker.GetFhirClient();
|
|
135
|
+
if (fhirClient) return fhirClient;
|
|
139
136
|
const fhirOptions = this.#options.fhirOptions;
|
|
140
137
|
const options = {
|
|
141
138
|
fhirServerEndpoint: fhirOptions.stsfhirserverendpoint,
|
|
@@ -152,11 +149,11 @@ var TestCaseFhirBase = class {
|
|
|
152
149
|
GetConnectionAccessToken: this.GetAccessTokenForSocketClientAccess,
|
|
153
150
|
GetAccessToken: this.GetAccessToken
|
|
154
151
|
};
|
|
155
|
-
if (this.runner.options.fhirOptions.stsfhirsocketclientmode === "socket-client-all-in-one")
|
|
156
|
-
else
|
|
157
|
-
await
|
|
158
|
-
this.runnerExecutionWorker.fhirClient
|
|
159
|
-
return
|
|
152
|
+
if (this.runner.options.fhirOptions.stsfhirsocketclientmode === "socket-client-all-in-one") fhirClient = new FhirSocketClientAllInOne("FhirSocketClient", options);
|
|
153
|
+
else fhirClient = new FhirSocketClientIndividual("FhirSocketClient", options);
|
|
154
|
+
await fhirClient.WaitForSocketConnected();
|
|
155
|
+
this.runnerExecutionWorker.SetFhirClient(fhirClient);
|
|
156
|
+
return fhirClient;
|
|
160
157
|
} catch (error) {
|
|
161
158
|
this.LogErrorMessage(error);
|
|
162
159
|
throw error;
|
|
@@ -428,23 +425,11 @@ var TestCaseFhirBase = class {
|
|
|
428
425
|
StopRunner = async () => {
|
|
429
426
|
await this.#OutputLogMessage(`StopRunner [${this.#runner.id}]`);
|
|
430
427
|
await this.#ForcePublishTelemetryData();
|
|
431
|
-
if (this.fhirClient) {
|
|
432
|
-
this.Debug(chalk.magenta(`TestCaseFhirBase:StopRunner(): Calling: [fhirClient.ResetSocket()]`));
|
|
433
|
-
this.fhirClient.ResetSocket();
|
|
434
|
-
await Sleep(100);
|
|
435
|
-
this.fhirClient = null;
|
|
436
|
-
}
|
|
437
428
|
return true;
|
|
438
429
|
};
|
|
439
430
|
TerminateRunner = async () => {
|
|
440
431
|
await this.#OutputLogMessage(`TerminateRunner [${this.#runner.id}]`);
|
|
441
432
|
await this.#ForcePublishTelemetryData();
|
|
442
|
-
if (this.fhirClient) {
|
|
443
|
-
this.Debug(chalk.magenta(`TestCaseFhirBase:TerminateRunner(): Calling: [fhirClient.ResetSocket()]`));
|
|
444
|
-
this.fhirClient.ResetSocket();
|
|
445
|
-
await Sleep(100);
|
|
446
|
-
this.fhirClient = null;
|
|
447
|
-
}
|
|
448
433
|
return true;
|
|
449
434
|
};
|
|
450
435
|
Completed = async () => {
|
|
@@ -452,12 +437,6 @@ var TestCaseFhirBase = class {
|
|
|
452
437
|
this.runner.instrumentData.timer = performance.now() - start;
|
|
453
438
|
await this.#OutputLogMessage(`Completed [${this.#runner.id}] [${JSON.stringify(this.#runner.instrumentData)}]`);
|
|
454
439
|
await this.#ForcePublishTelemetryData();
|
|
455
|
-
if (this.fhirClient) {
|
|
456
|
-
this.Debug(chalk.magenta(`TestCaseFhirBase:Completed(): Calling: [fhirClient.ResetSocket()]`));
|
|
457
|
-
this.fhirClient.ResetSocket();
|
|
458
|
-
await Sleep(100);
|
|
459
|
-
this.fhirClient = null;
|
|
460
|
-
}
|
|
461
440
|
return true;
|
|
462
441
|
};
|
|
463
442
|
PauseRunner = async () => {
|
|
@@ -473,12 +452,6 @@ var TestCaseFhirBase = class {
|
|
|
473
452
|
ResetRunner = async () => {
|
|
474
453
|
await this.#OutputLogMessage(`ResetRunner [${this.#runner.id}]`);
|
|
475
454
|
await this.#ForcePublishTelemetryData();
|
|
476
|
-
if (this.fhirClient) {
|
|
477
|
-
this.Debug(chalk.magenta(`TestCaseFhirBase:ResetRunner(): Calling: [fhirClient.ResetSocket()]`));
|
|
478
|
-
this.fhirClient.ResetSocket();
|
|
479
|
-
await Sleep(100);
|
|
480
|
-
this.fhirClient = null;
|
|
481
|
-
}
|
|
482
455
|
return true;
|
|
483
456
|
};
|
|
484
457
|
UpdateRunner = async () => {
|
|
@@ -35808,12 +35781,18 @@ var ResourceDataGenerator = class {
|
|
|
35808
35781
|
var WorkerFhirTestCases = class extends AbstractRunnerExecutionWorker {
|
|
35809
35782
|
_options;
|
|
35810
35783
|
_resourceDataGenerator;
|
|
35784
|
+
fhirClient = void 0;
|
|
35811
35785
|
constructor(options) {
|
|
35812
35786
|
super();
|
|
35813
35787
|
this._options = options;
|
|
35814
35788
|
this._resourceDataGenerator = new ResourceDataGenerator();
|
|
35815
35789
|
}
|
|
35816
|
-
|
|
35790
|
+
GetFhirClient = () => {
|
|
35791
|
+
return this.fhirClient;
|
|
35792
|
+
};
|
|
35793
|
+
SetFhirClient = (fhirClient) => {
|
|
35794
|
+
this.fhirClient = fhirClient;
|
|
35795
|
+
};
|
|
35817
35796
|
get resourceDataGenerator() {
|
|
35818
35797
|
return this._resourceDataGenerator;
|
|
35819
35798
|
}
|