Skip to content

Commit 1d6fedf

Browse files
Remove deprecated configs from tests and documentation (#2665)
* remove deprecated configs from tests and documentation * add tests * lint Co-authored-by: Kyle Verhoog <[email protected]>
1 parent c44c1b4 commit 1d6fedf

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

docs/advanced_usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ sure your application has a route to the tracing Agent. An easy way to test
622622
this is with a::
623623

624624
$ pip install ipython
625-
$ DATADOG_TRACE_DEBUG=true ddtrace-run ipython
625+
$ DD_TRACE_DEBUG=true ddtrace-run ipython
626626

627627
Because iPython uses SQLite, it will be automatically instrumented and your
628628
traces should be sent off. If an error occurs, a message will be displayed in

tests/commands/test_runner.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,24 @@ def test_integration(self):
8686

8787
def test_debug_enabling(self):
8888
"""
89-
{DD,DATADOG}_TRACE_DEBUG=true allows setting debug logging of the global tracer
89+
DD_TRACE_DEBUG=true allows setting debug logging of the global tracer.
90+
Test DATADOG_TRACE_DEBUG flag for backwards compatibility
9091
"""
92+
with self.override_env(dict(DD_TRACE_DEBUG="false")):
93+
out = subprocess.check_output(
94+
["ddtrace-run", "python", "tests/commands/ddtrace_run_no_debug.py"], stderr=subprocess.STDOUT
95+
)
96+
assert b"Test success" in out
97+
assert b"DATADOG TRACER CONFIGURATION" not in out
98+
99+
with self.override_env(dict(DD_TRACE_DEBUG="true")):
100+
out = subprocess.check_output(
101+
["ddtrace-run", "python", "tests/commands/ddtrace_run_debug.py"],
102+
stderr=subprocess.STDOUT,
103+
)
104+
assert b"Test success" in out
105+
assert b"DATADOG TRACER CONFIGURATION" in out
106+
91107
with self.override_env(dict(DATADOG_TRACE_DEBUG="false")):
92108
out = subprocess.check_output(
93109
["ddtrace-run", "python", "tests/commands/ddtrace_run_no_debug.py"], stderr=subprocess.STDOUT

tests/integration/test_debug.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def test_different_samplers():
310310
def test_error_output_ddtracerun_debug_mode():
311311
p = subprocess.Popen(
312312
["ddtrace-run", "python", "tests/integration/hello.py"],
313-
env=dict(DD_TRACE_AGENT_URL="http://localhost:8126", DATADOG_TRACE_DEBUG="true", **os.environ),
313+
env=dict(DD_TRACE_AGENT_URL="http://localhost:8126", DD_TRACE_DEBUG="true", **os.environ),
314314
stdout=subprocess.PIPE,
315315
stderr=subprocess.PIPE,
316316
)
@@ -322,7 +322,7 @@ def test_error_output_ddtracerun_debug_mode():
322322
# No connection to agent, debug mode enabled
323323
p = subprocess.Popen(
324324
["ddtrace-run", "python", "tests/integration/hello.py"],
325-
env=dict(DD_TRACE_AGENT_URL="http://localhost:4321", DATADOG_TRACE_DEBUG="true", **os.environ),
325+
env=dict(DD_TRACE_AGENT_URL="http://localhost:4321", DD_TRACE_DEBUG="true", **os.environ),
326326
stdout=subprocess.PIPE,
327327
stderr=subprocess.PIPE,
328328
)
@@ -337,7 +337,7 @@ def test_error_output_ddtracerun():
337337
# Connection to agent, debug mode disabled
338338
p = subprocess.Popen(
339339
["ddtrace-run", "python", "tests/integration/hello.py"],
340-
env=dict(DD_TRACE_AGENT_URL="http://localhost:8126", DATADOG_TRACE_DEBUG="false", **os.environ),
340+
env=dict(DD_TRACE_AGENT_URL="http://localhost:8126", DD_TRACE_DEBUG="false", **os.environ),
341341
stdout=subprocess.PIPE,
342342
stderr=subprocess.PIPE,
343343
)
@@ -350,7 +350,7 @@ def test_error_output_ddtracerun():
350350
# No connection to agent, debug mode disabled
351351
p = subprocess.Popen(
352352
["ddtrace-run", "python", "tests/integration/hello.py"],
353-
env=dict(DD_TRACE_AGENT_URL="http://localhost:4321", DATADOG_TRACE_DEBUG="false", **os.environ),
353+
env=dict(DD_TRACE_AGENT_URL="http://localhost:4321", DD_TRACE_DEBUG="false", **os.environ),
354354
stdout=subprocess.PIPE,
355355
stderr=subprocess.PIPE,
356356
)

tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def override_env(env):
5454
"""
5555
Temporarily override ``os.environ`` with provided values::
5656
57-
>>> with self.override_env(dict(DATADOG_TRACE_DEBUG=True)):
57+
>>> with self.override_env(dict(DD_TRACE_DEBUG=True)):
5858
# Your test
5959
"""
6060
# Copy the full original environment

0 commit comments

Comments
 (0)