@@ -96,43 +96,17 @@ describe('OTLP Integration Tests', () => {
9696 } ) ;
9797
9898 describe ( 'OTLP Response Validation (SVLS-8626)' , ( ) => {
99- it ( 'should invoke response-validation Lambda successfully' , ( ) => {
100- expect ( results . responseValidation . statusCode ) . toBe ( 200 ) ;
101- } ) ;
102-
103- it ( 'should accept JSON encoded OTLP traces' , ( ) => {
104- const body = JSON . parse ( results . responseValidation . payload ?. body || '{}' ) ;
105- expect ( body . json ?. success ) . toBe ( true ) ;
106- } ) ;
107-
108- it ( 'should accept Protobuf encoded OTLP traces' , ( ) => {
109- const body = JSON . parse ( results . responseValidation . payload ?. body || '{}' ) ;
110- expect ( body . protobuf ?. success ) . toBe ( true ) ;
111- } ) ;
112-
113- it ( 'should send at least one trace to Datadog' , ( ) => {
114- expect ( results . responseValidation . traces ?. length ) . toBeGreaterThan ( 0 ) ;
115- } ) ;
116-
11799 it ( 'should have JSON encoded span in Datadog' , ( ) => {
118- const body = JSON . parse ( results . responseValidation . payload ?. body || '{}' ) ;
119- const requestId = body . requestId ;
120100 const allSpans = results . responseValidation . traces ?. flatMap ( t => t . spans ) || [ ] ;
121- const currentRunSpans = allSpans . filter ( s => s . attributes ?. custom ?. request_id === requestId ) ;
122-
123- const hasJsonSpan = currentRunSpans . some ( s =>
101+ const hasJsonSpan = allSpans . some ( s =>
124102 s . attributes ?. resource_name === 'test-span-json' && s . attributes ?. custom ?. encoding === 'json'
125103 ) ;
126104 expect ( hasJsonSpan ) . toBe ( true ) ;
127105 } ) ;
128106
129107 it ( 'should have Protobuf encoded span in Datadog' , ( ) => {
130- const body = JSON . parse ( results . responseValidation . payload ?. body || '{}' ) ;
131- const requestId = body . requestId ;
132108 const allSpans = results . responseValidation . traces ?. flatMap ( t => t . spans ) || [ ] ;
133- const currentRunSpans = allSpans . filter ( s => s . attributes ?. custom ?. request_id === requestId ) ;
134-
135- const hasProtobufSpan = currentRunSpans . some ( s =>
109+ const hasProtobufSpan = allSpans . some ( s =>
136110 s . attributes ?. resource_name === 'test-span-protobuf' && s . attributes ?. custom ?. encoding === 'protobuf'
137111 ) ;
138112 expect ( hasProtobufSpan ) . toBe ( true ) ;
0 commit comments