@nsshunt/ststestrunner 1.1.78 → 1.1.79

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.
@@ -569,6 +569,15 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
569
569
  _GetDetail = () => {
570
570
  return `testType: [${this.runner.options.testType}], description: [${this.runner.options.description}], workerManagerId: [${this.runner.workerManagerId}], Iteration: [${this.runner.iteration}]`;
571
571
  };
572
+ _CheckOutputLongDurationError = (snapshotStart, message) => {
573
+ const snapShotEnd = performance.now();
574
+ if (snapShotEnd - snapshotStart > 1e3) {
575
+ this.Error(chalk.default.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): *** ==> Long execution: [${snapShotEnd - snapshotStart}] message: [${message}]`));
576
+ this.Error(chalk.default.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): ==> ${this._GetDetail()}`));
577
+ this.Error(chalk.default.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): ==> Note: While not specifically an error, this is logged as an error.`));
578
+ }
579
+ return snapShotEnd;
580
+ };
572
581
  ExecuteRunner = async () => {
573
582
  if (this.runner.iteration % 100 === 0) this.Debug(`TestCaseFhirQueryBase:ExecuteRunner(): ${this._GetDetail()}`);
574
583
  const start = performance.now();
@@ -629,7 +638,9 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
629
638
  var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
630
639
  ExecuteQuery = async () => {
631
640
  try {
641
+ const __snapshot1 = performance.now();
632
642
  await this.GetAccessToken();
643
+ this._CheckOutputLongDurationError(__snapshot1, "await this.GetAccessToken()");
633
644
  this.accesssToken = null;
634
645
  return null;
635
646
  } catch (error) {
@@ -644,10 +655,15 @@ var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
644
655
  var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
645
656
  ExecuteQuery = async () => {
646
657
  try {
658
+ const __snapshot1 = performance.now();
647
659
  const client = await this.GetClient();
660
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
648
661
  const prefix = this.runner.options.personPrefix;
649
662
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "1");
650
- return (await client.PostResource("Person", personRecord)).body;
663
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
664
+ const retVal = await client.PostResource("Person", personRecord);
665
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PostResource()");
666
+ return retVal.body;
651
667
  } catch (error) {
652
668
  this.runner.instrumentData.errorCount++;
653
669
  this.Error(`TestCaseFhir02:ExecuteQuery(): Error: [${error}]`);
@@ -660,9 +676,13 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
660
676
  var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
661
677
  ExecuteQuery = async () => {
662
678
  try {
679
+ const __snapshot1 = performance.now();
663
680
  const client = await this.GetClient();
681
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
664
682
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
683
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
665
684
  const retVal = await client.GetResource("Person", personRecord.id);
685
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
666
686
  delete personRecord.meta;
667
687
  delete retVal.body.meta;
668
688
  const p1 = JSON.stringify(personRecord);
@@ -681,9 +701,13 @@ var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
681
701
  var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
682
702
  ExecuteQuery = async () => {
683
703
  try {
704
+ const __snapshot1 = performance.now();
684
705
  const client = await this.GetClient();
706
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
685
707
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
708
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
686
709
  const retVal = await client.GetResource("Person", personRecord.id);
710
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
687
711
  this.runner.instrumentData.requestCount++;
688
712
  const compPersonRecord = { ...personRecord };
689
713
  const loadedPersonRecorded = { ...retVal.body };
@@ -699,6 +723,7 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
699
723
  if (originalPersonRecord && originalPersonRecord.text) {
700
724
  originalPersonRecord.text.div = `Put record TestCaseFhir04 ${this.runner.iteration}`;
701
725
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"1"`);
726
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PutResource()");
702
727
  const updatedRecord = { ...retVal.body };
703
728
  delete updatedRecord.meta;
704
729
  delete originalPersonRecord.meta;
@@ -722,11 +747,15 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
722
747
  var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
723
748
  ExecuteQuery = async () => {
724
749
  try {
750
+ const __snapshot1 = performance.now();
725
751
  const client = await this.GetClient();
752
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
726
753
  const originalPersonRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "2");
754
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
727
755
  if (originalPersonRecord && originalPersonRecord.text) {
728
756
  originalPersonRecord.text.div = `Put record TestCaseFhir05 ${this.runner.iteration}`;
729
757
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"2"`);
758
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PutResource()");
730
759
  const updatedRecord = { ...retVal.body };
731
760
  delete updatedRecord.meta;
732
761
  delete originalPersonRecord.meta;
@@ -750,11 +779,13 @@ var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
750
779
  var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
751
780
  ExecuteQuery = async () => {
752
781
  try {
782
+ const __snapshot1 = performance.now();
753
783
  const client = await this.GetClient();
784
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
754
785
  const baseUrl = this.runner.options.fhirOptions.stsfhirbaseurl;
755
786
  const prefix = this.runner.options.personPrefix;
756
787
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "3");
757
- performance.now();
788
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
758
789
  const url = new URL(`${baseUrl}/Person?family=${personRecord.name[0].family}`);
759
790
  let retVal;
760
791
  if (this.runner.options.useDirectQuery === true) {
@@ -763,8 +794,11 @@ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
763
794
  family: personRecord.name[0].family
764
795
  };
765
796
  retVal = await client.GenericSearchTesting("Person", data);
766
- } else retVal = await client.GetResources(url);
767
- performance.now();
797
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GenericSearchTesting()");
798
+ } else {
799
+ retVal = await client.GetResources(url);
800
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResources()");
801
+ }
768
802
  return retVal.body;
769
803
  } catch (error) {
770
804
  this.runner.instrumentData.errorCount++;
@@ -1425,13 +1459,20 @@ var fast_json_patch_default = Object.assign({}, core_exports, duplex_exports, {
1425
1459
  var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1426
1460
  ExecuteQuery = async () => {
1427
1461
  try {
1462
+ const __snapshot1 = performance.now();
1428
1463
  const client = await this.GetClient();
1464
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1429
1465
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "3");
1430
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1466
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1467
+ const retVal = await client.GetResource("Person", personRecord.id);
1468
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1469
+ const resource = retVal.body;
1431
1470
  const observer = fast_json_patch_default.observe(resource);
1432
1471
  resource.text.div = `Json Patched record TestCaseFhir07 ${this.runner.iteration}`;
1433
1472
  const patchRecord = fast_json_patch_default.generate(observer);
1434
- return (await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`)).body;
1473
+ const retValPatched = await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`);
1474
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1475
+ return retValPatched.body;
1435
1476
  } catch (error) {
1436
1477
  this.runner.instrumentData.errorCount++;
1437
1478
  this.Error(`TestCaseFhir07:ExecuteQuery(): Error: [${error}]`);
@@ -1444,11 +1485,18 @@ var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1444
1485
  var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1445
1486
  ExecuteQuery = async () => {
1446
1487
  try {
1488
+ const __snapshot1 = performance.now();
1447
1489
  const client = await this.GetClient();
1490
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1448
1491
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "4");
1449
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1492
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1493
+ const retVal = await client.GetResource("Person", personRecord.id);
1494
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1495
+ const resource = retVal.body;
1450
1496
  resource.text.div = `Merge Patched record TestCaseFhir08 ${this.runner.iteration}`;
1451
- return (await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`)).body;
1497
+ const retValPatched = await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`);
1498
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1499
+ return retValPatched.body;
1452
1500
  } catch (error) {
1453
1501
  this.runner.instrumentData.errorCount++;
1454
1502
  this.Error(`TestCaseFhir08:ExecuteQuery(): Error: [${error}]`);
@@ -1461,10 +1509,16 @@ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1461
1509
  var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1462
1510
  ExecuteQuery = async () => {
1463
1511
  try {
1512
+ const __snapshot1 = performance.now();
1464
1513
  const client = await this.GetClient();
1514
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1465
1515
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "5");
1466
- if (personRecord.text) return (await client.DeleteResource("Person", personRecord.id, `W/"5"`)).body;
1467
- else {
1516
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1517
+ if (personRecord.text) {
1518
+ const retVal = await client.DeleteResource("Person", personRecord.id, `W/"5"`);
1519
+ this._CheckOutputLongDurationError(__snapshot3, "await this.DeleteResource()");
1520
+ return retVal.body;
1521
+ } else {
1468
1522
  this.runner.instrumentData.errorCount++;
1469
1523
  return null;
1470
1524
  }
@@ -1480,9 +1534,14 @@ var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1480
1534
  var TestCaseFhir10 = class extends TestCaseFhirQueryBase {
1481
1535
  ExecuteQuery = async () => {
1482
1536
  try {
1537
+ const __snapshot1 = performance.now();
1483
1538
  const client = await this.GetClient();
1539
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1484
1540
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
1485
- return (await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2")).body;
1541
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1542
+ const retVal = await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2");
1543
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetHistoryInstanceFhirResource()");
1544
+ return retVal.body;
1486
1545
  } catch (error) {
1487
1546
  this.runner.instrumentData.errorCount++;
1488
1547
  this.Error(`TestCaseFhir10:ExecuteQuery(): Error: [${error}]`);