Skip to content

Commit 6ffbd4a

Browse files
chore(ci_visibility): set span type to "test" for ddtrace integrations (#15526)
## Description The Selenium integration checks if the root span is of `test` type before adding its tags. This PR adjusts the span type of the ddtrace span created by the new pytest plugin. Additionally, fix the `selenium` riot environment to use the correct env var to set the test agent port. ## Testing Manual testing to see that the Selenium integration works with the new plugin. Currently we can't do snapshot tests with the new plugin because the test agent does not support citestcycle traces sent via EVP proxy mode, and the new plugin does not support the legacy mode. ## Risks None. ## Additional Notes None.
1 parent 7f7bcc8 commit 6ffbd4a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ddtrace/testing/internal/tracer_api/context.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ def _ddtrace_context() -> t.Generator[DDTraceTestContext, None, None]:
8080
ddtrace.tracer.context_provider.activate(None)
8181

8282
with ddtrace.tracer.trace(DDTESTOPT_ROOT_SPAN_RESOURCE) as root_span:
83+
root_span.set_tag("type", "test") # Selenium integration checks the span type.
84+
root_span.set_tag("span.kind", "test")
8385
yield DDTraceTestContext(root_span)
8486

8587

riotfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3428,7 +3428,7 @@ def select_pys(min_version: str = MIN_PYTHON_VERSION, max_version: str = MAX_PYT
34283428
},
34293429
command="pytest --no-cov {cmdargs} -c /dev/null --no-ddtrace tests/contrib/selenium",
34303430
env={
3431-
"DD_AGENT_TRACER_URL": "9126",
3431+
"DD_AGENT_PORT": "9126",
34323432
},
34333433
venvs=[
34343434
Venv(

0 commit comments

Comments
 (0)