@@ -148,13 +148,14 @@ describe('Tracer integration tests', () => {
148
148
// Assert that the subsegment name is the expected one
149
149
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
150
150
if ( handlerSubsegment ?. subsegments !== undefined ) {
151
- // Assert that there're two subsegments
152
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 2 ) ;
151
+ // Assert that there're three subsegments
152
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
153
153
154
- const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 ] = handlerSubsegment ?. subsegments ;
155
- // Assert that the subsegment names is the expected ones
154
+ const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 , HTTPSegment ] = handlerSubsegment ?. subsegments ;
155
+ // Assert that the subsegment names are the expected ones
156
156
expect ( AWSSDKSubsegment1 . name ) . toBe ( 'DynamoDB' ) ;
157
157
expect ( AWSSDKSubsegment2 . name ) . toBe ( 'DynamoDB' ) ;
158
+ expect ( HTTPSegment . name ) . toBe ( 'httpbin.org' ) ;
158
159
159
160
const { annotations, metadata } = handlerSubsegment ;
160
161
@@ -219,12 +220,13 @@ describe('Tracer integration tests', () => {
219
220
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
220
221
if ( handlerSubsegment ?. subsegments !== undefined ) {
221
222
// Assert that there're two subsegments
222
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 2 ) ;
223
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
223
224
224
- const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 ] = handlerSubsegment ?. subsegments ;
225
- // Assert that the subsegment names is the expected ones
225
+ const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 , HTTPSegment ] = handlerSubsegment ?. subsegments ;
226
+ // Assert that the subsegment names are the expected ones
226
227
expect ( AWSSDKSubsegment1 . name ) . toBe ( 'DynamoDB' ) ;
227
228
expect ( AWSSDKSubsegment2 . name ) . toBe ( 'DynamoDB' ) ;
229
+ expect ( HTTPSegment . name ) . toBe ( 'httpbin.org' ) ;
228
230
229
231
const { annotations, metadata } = handlerSubsegment ;
230
232
@@ -289,12 +291,13 @@ describe('Tracer integration tests', () => {
289
291
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
290
292
if ( handlerSubsegment ?. subsegments !== undefined ) {
291
293
// Assert that there're two subsegments
292
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 2 ) ;
294
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
293
295
294
- const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 ] = handlerSubsegment ?. subsegments ;
295
- // Assert that the subsegment names is the expected ones
296
+ const [ AWSSDKSubsegment1 , AWSSDKSubsegment2 , HTTPSegment ] = handlerSubsegment ?. subsegments ;
297
+ // Assert that the subsegment names are the expected ones
296
298
expect ( AWSSDKSubsegment1 . name ) . toBe ( 'DynamoDB' ) ;
297
299
expect ( AWSSDKSubsegment2 . name ) . toBe ( 'DynamoDB' ) ;
300
+ expect ( HTTPSegment . name ) . toBe ( 'httpbin.org' ) ;
298
301
299
302
const { annotations, metadata } = handlerSubsegment ;
300
303
@@ -381,18 +384,21 @@ describe('Tracer integration tests', () => {
381
384
// Assert that the subsegment name is the expected one
382
385
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
383
386
if ( handlerSubsegment ?. subsegments !== undefined ) {
384
- // Assert that there're three subsegments
385
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
387
+ // Assert that there're four subsegments
388
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 4 ) ;
386
389
387
390
// Sort the subsegments by name
388
391
const dynamoDBSubsegments : ParsedDocument [ ] = [ ] ;
389
392
const methodSubsegment : ParsedDocument [ ] = [ ] ;
393
+ const httpSubsegment : ParsedDocument [ ] = [ ] ;
390
394
const otherSegments : ParsedDocument [ ] = [ ] ;
391
395
handlerSubsegment ?. subsegments . forEach ( subsegment => {
392
396
if ( subsegment . name === 'DynamoDB' ) {
393
397
dynamoDBSubsegments . push ( subsegment ) ;
394
398
} else if ( subsegment . name === '### myMethod' ) {
395
399
methodSubsegment . push ( subsegment ) ;
400
+ } else if ( subsegment . name === 'httpbin.org' ) {
401
+ httpSubsegment . push ( subsegment ) ;
396
402
} else {
397
403
otherSegments . push ( subsegment ) ;
398
404
}
@@ -401,6 +407,8 @@ describe('Tracer integration tests', () => {
401
407
expect ( dynamoDBSubsegments . length ) . toBe ( 2 ) ;
402
408
// Assert that there is exactly one subsegment with the name '### myMethod'
403
409
expect ( methodSubsegment . length ) . toBe ( 1 ) ;
410
+ // Assert that there is exactly one subsegment with the name 'httpbin.org'
411
+ expect ( httpSubsegment . length ) . toBe ( 1 ) ;
404
412
// Assert that there are exactly zero other subsegments
405
413
expect ( otherSegments . length ) . toBe ( 0 ) ;
406
414
@@ -478,18 +486,21 @@ describe('Tracer integration tests', () => {
478
486
// Assert that the subsegment name is the expected one
479
487
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
480
488
if ( handlerSubsegment ?. subsegments !== undefined ) {
481
- // Assert that there're three subsegments
482
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
489
+ // Assert that there're four subsegments
490
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 4 ) ;
483
491
484
492
// Sort the subsegments by name
485
493
const dynamoDBSubsegments : ParsedDocument [ ] = [ ] ;
486
494
const methodSubsegment : ParsedDocument [ ] = [ ] ;
495
+ const httpSubsegment : ParsedDocument [ ] = [ ] ;
487
496
const otherSegments : ParsedDocument [ ] = [ ] ;
488
497
handlerSubsegment ?. subsegments . forEach ( subsegment => {
489
498
if ( subsegment . name === 'DynamoDB' ) {
490
499
dynamoDBSubsegments . push ( subsegment ) ;
491
500
} else if ( subsegment . name === '### myMethod' ) {
492
501
methodSubsegment . push ( subsegment ) ;
502
+ } else if ( subsegment . name === 'httpbin.org' ) {
503
+ httpSubsegment . push ( subsegment ) ;
493
504
} else {
494
505
otherSegments . push ( subsegment ) ;
495
506
}
@@ -498,6 +509,8 @@ describe('Tracer integration tests', () => {
498
509
expect ( dynamoDBSubsegments . length ) . toBe ( 2 ) ;
499
510
// Assert that there is exactly one subsegment with the name '### myMethod'
500
511
expect ( methodSubsegment . length ) . toBe ( 1 ) ;
512
+ // Assert that there is exactly one subsegment with the name 'httpbin.org'
513
+ expect ( httpSubsegment . length ) . toBe ( 1 ) ;
501
514
// Assert that there are exactly zero other subsegments
502
515
expect ( otherSegments . length ) . toBe ( 0 ) ;
503
516
@@ -575,18 +588,21 @@ describe('Tracer integration tests', () => {
575
588
// Assert that the subsegment name is the expected one
576
589
expect ( handlerSubsegment . name ) . toBe ( '## index.handler' ) ;
577
590
if ( handlerSubsegment ?. subsegments !== undefined ) {
578
- // Assert that there're three subsegments
579
- expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 3 ) ;
591
+ // Assert that there're four subsegments
592
+ expect ( handlerSubsegment ?. subsegments ?. length ) . toBe ( 4 ) ;
580
593
581
594
// Sort the subsegments by name
582
595
const dynamoDBSubsegments : ParsedDocument [ ] = [ ] ;
583
596
const methodSubsegment : ParsedDocument [ ] = [ ] ;
597
+ const httpSubsegment : ParsedDocument [ ] = [ ] ;
584
598
const otherSegments : ParsedDocument [ ] = [ ] ;
585
599
handlerSubsegment ?. subsegments . forEach ( subsegment => {
586
600
if ( subsegment . name === 'DynamoDB' ) {
587
601
dynamoDBSubsegments . push ( subsegment ) ;
588
602
} else if ( subsegment . name === '### myMethod' ) {
589
603
methodSubsegment . push ( subsegment ) ;
604
+ } else if ( subsegment . name === 'httpbin.org' ) {
605
+ httpSubsegment . push ( subsegment ) ;
590
606
} else {
591
607
otherSegments . push ( subsegment ) ;
592
608
}
@@ -595,6 +611,8 @@ describe('Tracer integration tests', () => {
595
611
expect ( dynamoDBSubsegments . length ) . toBe ( 2 ) ;
596
612
// Assert that there is exactly one subsegment with the name '### myMethod'
597
613
expect ( methodSubsegment . length ) . toBe ( 1 ) ;
614
+ // Assert that there is exactly one subsegment with the name 'httpbin.org'
615
+ expect ( httpSubsegment . length ) . toBe ( 1 ) ;
598
616
// Assert that there are exactly zero other subsegments
599
617
expect ( otherSegments . length ) . toBe ( 0 ) ;
600
618
// Assert that no response was captured on the subsegment
0 commit comments