-
Notifications
You must be signed in to change notification settings - Fork 9
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
Khanayan123/implement dd trace agent url system test #3073
base: main
Are you sure you want to change the base?
Changes from 7 commits
33ed196
afedfdf
fb6172a
4c7d51a
3712cb6
2de9be5
c46f5ce
4227910
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -137,6 +137,7 @@ tests/: | |||||
Test_Dsm_Manual_Checkpoint_Intra_Process: missing_feature | ||||||
parametric/: | ||||||
test_config_consistency.py: | ||||||
Test_Config_DDTraceAgentURL: missing_feature | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in naming:
Suggested change
|
||||||
Test_Config_TraceEnabled: missing_feature | ||||||
Test_Config_TraceLogDirectory: missing_feature | ||||||
Test_Config_UnifiedServiceTagging: missing_feature | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -517,6 +517,7 @@ tests/: | |
TestAdmisionControllerProfiling: *ref_5_22_0 | ||
parametric/: | ||
test_config_consistency.py: | ||
Test_Config_DDTraceAgentURL: *ref_5_23_0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was this feature just merged to master ? this version hasn't been released yet |
||
Test_Config_TraceEnabled: missing_feature | ||
Test_Config_TraceLogDirectory: missing_feature | ||
Test_Config_UnifiedServiceTagging: missing_feature | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -118,3 +118,43 @@ def test_specific_env(self, library_env, test_agent, test_library): | |||||||
|
||||||||
span = find_span_in_traces(traces, s1.trace_id, s1.span_id) | ||||||||
assert span["meta"]["env"] == "dev" | ||||||||
|
||||||||
|
||||||||
@scenarios.parametric | ||||||||
@features.tracing_configuration_consistency | ||||||||
class Test_Config_TraceAgentURL: | ||||||||
# DD_TRACE_AGENT_URL is validated using the tracer configuration. This approach avoids the need to modify the setup file to create additional containers at the specified URL, which would be unnecessarily complex. | ||||||||
@parametrize( | ||||||||
"library_env", | ||||||||
[ | ||||||||
{ | ||||||||
"DD_TRACE_AGENT_URL": "unix:///var/run/datadog/apm.socket", | ||||||||
"DD_AGENT_HOST": "localhost", | ||||||||
"DD_AGENT_PORT": "8126", | ||||||||
} | ||||||||
], | ||||||||
) | ||||||||
def test_dd_trace_agent_unix_url_nonexistent(self, library_env, test_agent, test_library): | ||||||||
with test_library as t: | ||||||||
resp = t.get_tracer_config() | ||||||||
assert resp["dd_trace_agent_url"] == "unix:///var/run/datadog/apm.socket" | ||||||||
with pytest.raises(ValueError): | ||||||||
test_agent.wait_for_num_traces(num=1, clear=True) | ||||||||
assert ( | ||||||||
True | ||||||||
), "wait_for_num_traces raises an exception after waiting for 1 trace." # wait_for_num_traces will throw an error if not received within 2 sec, so we expect to see an exception | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need this assertion. If a ValueError is not raised on line 141 then this test will fail. If you want to add an assertion you can check the error message in the value error and ensure it's do to a timeout/missing spans and not some other failure.
Suggested change
|
||||||||
|
||||||||
# The DD_TRACE_AGENT_URL is validated using the tracer configuration. This approach avoids the need to modify the setup file to create additional containers at the specified URL, which would be unnecessarily complex. | ||||||||
@parametrize( | ||||||||
"library_env", | ||||||||
[{"DD_TRACE_AGENT_URL": "http://random-host:9999/", "DD_AGENT_HOST": "localhost", "DD_AGENT_PORT": "8126"}], | ||||||||
) | ||||||||
def test_dd_trace_agent_http_url_nonexistent(self, library_env, test_agent, test_library): | ||||||||
with test_library as t: | ||||||||
resp = t.get_tracer_config() | ||||||||
assert resp["dd_trace_agent_url"] == "http://random-host:9999/" | ||||||||
with pytest.raises(ValueError): | ||||||||
test_agent.wait_for_num_traces(num=1, clear=True) | ||||||||
assert ( | ||||||||
True | ||||||||
), "wait_for_num_traces raises an exception after waiting for 1 trace." # wait_for_num_traces will throw an error if not received within 2 sec, so we expect to see an exception | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to set this to missing_feature? Can we just get this test to pass in this PR OR leave a descriptive message on why this test is failing (ex:
missing_feauture (cpp does not support uds)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't necessarily need to give a reason for
missing_feature
, but it may help later on, so if you have one that is not as obvious as "we didn't started yet to work on this" , feel free to add it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mabdinur setting it to missing_feature as of now because the parametric client apps need to be updated to send dd_trace_agent_url