Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(profiling): unset DD_SITE variable in agentless URL check [backport 1.17] #6644

Merged
merged 2 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,13 @@ def run_function_from_file(item, params=None):
pythonpath = os.getenv("PYTHONPATH", None)
base_path = os.path.dirname(os.path.dirname(__file__))
env["PYTHONPATH"] = os.pathsep.join((base_path, pythonpath)) if pythonpath is not None else base_path
env.update(marker.kwargs.get("env", {}))

for key, value in marker.kwargs.get("env", {}).items():
if value is None: # None means remove the variable
env.pop(key, None)
else:
env[key] = value

if params is not None:
env.update(params)

Expand Down
2 changes: 1 addition & 1 deletion tests/profiling/test_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_disable_memory():


@pytest.mark.subprocess(
env=dict(DD_PROFILING_AGENTLESS="true", DD_API_KEY="foobar"),
env=dict(DD_PROFILING_AGENTLESS="true", DD_API_KEY="foobar", DD_SITE=None),
err=None,
)
def test_env_agentless():
Expand Down
Loading