Skip to content

Commit 58f49f2

Browse files
committed
fix tests
1 parent e25d2cf commit 58f49f2

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

Diff for: instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -268,20 +268,19 @@ def validate_outputs(self, outputs, error=None, modifiers=None):
268268
{
269269
"name": "GET / http receive",
270270
"kind": trace_api.SpanKind.INTERNAL,
271-
"attributes": {"type": "http.request"},
271+
"attributes": {},
272272
},
273273
{
274274
"name": "GET / http send",
275275
"kind": trace_api.SpanKind.INTERNAL,
276276
"attributes": {
277277
SpanAttributes.HTTP_STATUS_CODE: 200,
278-
"type": "http.response.start",
279278
},
280279
},
281280
{
282281
"name": "GET / http send",
283282
"kind": trace_api.SpanKind.INTERNAL,
284-
"attributes": {"type": "http.response.body"},
283+
"attributes": {},
285284
},
286285
{
287286
"name": "GET /",
@@ -358,7 +357,7 @@ def add_more_body_spans(expected: list):
358357
more_body_span = {
359358
"name": "GET / http send",
360359
"kind": trace_api.SpanKind.INTERNAL,
361-
"attributes": {"type": "http.response.body"},
360+
"attributes": {},
362361
}
363362
extra_spans = [more_body_span] * 3
364363
expected[2:2] = extra_spans
@@ -396,12 +395,12 @@ def add_body_and_trailer_span(expected: list):
396395
body_span = {
397396
"name": "GET / http send",
398397
"kind": trace_api.SpanKind.INTERNAL,
399-
"attributes": {"type": "http.response.body"},
398+
"attributes": {},
400399
}
401400
trailer_span = {
402401
"name": "GET / http send",
403402
"kind": trace_api.SpanKind.INTERNAL,
404-
"attributes": {"type": "http.response.trailers"},
403+
"attributes": {},
405404
}
406405
expected[2:2] = [body_span]
407406
expected[4:4] = [trailer_span] * 2
@@ -582,33 +581,31 @@ def test_websocket(self):
582581
{
583582
"name": "/ websocket receive",
584583
"kind": trace_api.SpanKind.INTERNAL,
585-
"attributes": {"type": "websocket.connect"},
584+
"attributes": {},
586585
},
587586
{
588587
"name": "/ websocket send",
589588
"kind": trace_api.SpanKind.INTERNAL,
590-
"attributes": {"type": "websocket.accept"},
589+
"attributes": {},
591590
},
592591
{
593592
"name": "/ websocket receive",
594593
"kind": trace_api.SpanKind.INTERNAL,
595594
"attributes": {
596-
"type": "websocket.receive",
597595
SpanAttributes.HTTP_STATUS_CODE: 200,
598596
},
599597
},
600598
{
601599
"name": "/ websocket send",
602600
"kind": trace_api.SpanKind.INTERNAL,
603601
"attributes": {
604-
"type": "websocket.send",
605602
SpanAttributes.HTTP_STATUS_CODE: 200,
606603
},
607604
},
608605
{
609606
"name": "/ websocket receive",
610607
"kind": trace_api.SpanKind.INTERNAL,
611-
"attributes": {"type": "websocket.disconnect"},
608+
"attributes": {},
612609
},
613610
{
614611
"name": "/",
@@ -638,6 +635,7 @@ def test_websocket_traceresponse_header(self):
638635
set_global_response_propagator(TraceResponsePropagator())
639636

640637
self.scope = {
638+
"type": "websocket",
641639
"http_version": "1.1",
642640
"scheme": "ws",
643641
"path": "/",

0 commit comments

Comments
 (0)