Skip to content

Commit

Permalink
w3c phase2: enable inject/extract tests for all client libraries (#2181)
Browse files Browse the repository at this point in the history
* w3c phase2: enable ruby tests

* Enable tests for next node release

* make test work with node

* enable tests for php

* update inject

* w3c phase 2 will ship in 2.0

* fix ruby version part 2

* lint

* revert unrelated changes

* log headers on failure

* fix failing node test

* revert unrelated changes
  • Loading branch information
mabdinur authored Apr 19, 2024
1 parent b02d9e7 commit b045281
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tests/parametric/test_headers_tracecontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,11 +716,11 @@ def test_tracestate_duplicated_keys(self, test_agent, test_library):

@missing_feature(context.library < "[email protected]", reason="Not implemented")
@missing_feature(context.library == "dotnet", reason="Not implemented")
@missing_feature(context.library == "php", reason="Not implemented")
@missing_feature(context.library == "nodejs", reason="Not implemented")
@missing_feature(context.library < "php@0.99.0", reason="Not implemented")
@missing_feature(context.library < "nodejs@5.6.0", reason="Not implemented")
@missing_feature(context.library == "java", reason="Not implemented")
@missing_feature(context.library == "cpp", reason="Not implemented")
@missing_feature(context.library == "ruby", reason="Not implemented")
@missing_feature(context.library < "ruby@2.0.0", reason="Not implemented")
@missing_feature(context.library == "golang", reason="Not implemented")
def test_tracestate_w3c_p_extract(self, test_agent, test_library):
"""
Expand Down Expand Up @@ -786,27 +786,26 @@ def test_tracestate_w3c_p_extract(self, test_agent, test_library):

@missing_feature(context.library < "[email protected]", reason="Not implemented")
@missing_feature(context.library == "dotnet", reason="Not implemented")
@missing_feature(context.library == "php", reason="Not implemented")
@missing_feature(context.library == "nodejs", reason="Not implemented")
@missing_feature(context.library < "php@0.99.0", reason="Not implemented")
@missing_feature(context.library < "nodejs@5.6.0", reason="Not implemented")
@missing_feature(context.library == "java", reason="Not implemented")
@missing_feature(context.library == "cpp", reason="Not implemented")
@missing_feature(context.library == "ruby", reason="Not implemented")
@missing_feature(context.library < "ruby@2.0.0", reason="Not implemented")
@missing_feature(context.library == "golang", reason="Not implemented")
def test_tracestate_w3c_p_inject(self, test_agent, test_library):
"""
Ensure the last parent id is propagated according to the W3C spec
"""
with test_library:
with test_library.start_span(name="new_span") as span:
pass

headers = test_library.inject_headers(span.span_id)
headers = test_library.inject_headers(span.span_id)

tracestate_headers = list(filter(lambda h: h[0].lower() == "tracestate", headers))
assert len(tracestate_headers) == 1

tracestate = tracestate_headers[0][1]
assert "p:{:016x}".format(span.span_id) in tracestate
# FIXME: nodejs paramerric app sets span.span_id to a string, convert this to an int
assert "p:{:016x}".format(int(span.span_id)) in tracestate

@temporary_enable_optin_tracecontext()
def test_tracestate_all_allowed_characters(self, test_agent, test_library):
Expand Down

0 comments on commit b045281

Please sign in to comment.