Skip to content

Commit e9dc229

Browse files
authored
Fix traces (#630)
* Fix traces current_trace_context isn't in the top module. Let's use it from the right place, and make sure it raises an error in CI next time it happens * Enforce CI check with RECORD
1 parent e8fcc82 commit e9dc229

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/test_integration.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ jobs:
6363
run: ./run-tests.sh
6464
shell: bash
6565
env:
66-
CI: "true"
6766
DD_AGENT_HOST: localhost
6867
DD_ENV: prod
6968
DD_SERVICE: datadog-api-client-python

tests/conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# First patch httplib
77
tracer = None
88
try:
9-
from ddtrace import config, current_trace_context, patch, tracer
9+
from ddtrace import config, patch, tracer
1010

1111
if os.getenv("RECORD", "false") != "none":
1212
from ddtrace.internal.writer import AgentWriter
@@ -44,7 +44,8 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
4444

4545

4646
except ImportError:
47-
pass
47+
if os.getenv("CI", "false") == "true" and os.getenv("RECORD", "false") == "none":
48+
raise
4849

4950
import importlib
5051
import json
@@ -87,7 +88,7 @@ def pytest_bdd_before_step(request, feature, scenario, step, step_func):
8788
step.type,
8889
resource=step.name,
8990
span_type=step.type,
90-
child_of=current_trace_context(),
91+
child_of=tracer.current_trace_context(),
9192
)
9293
setattr(step_func, "__dd_span__", span)
9394

0 commit comments

Comments
 (0)