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

Update 128 bit logging enabled tests and disable stable config tests #4251

Merged
merged 3 commits into from
Mar 5, 2025
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
10 changes: 7 additions & 3 deletions manifests/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ tests/:
Test_Config_TraceEnabled: v1.39.0
Test_Config_TraceLogDirectory: missing_feature
Test_Config_UnifiedServiceTagging: v1.41.1
Test_Stable_Config_Default: v1.47.0-SNAPSHOT
Test_Stable_Config_Default: missing_feature (waiting on APMAPI-298 to be merged)
test_crashtracking.py:
Test_Crashtracking: v1.38.0
test_dynamic_configuration.py:
Expand Down Expand Up @@ -1823,8 +1823,12 @@ tests/:
Test_Config_IntegrationEnabled_True:
'*': irrelevant (kafka endpoints are not implemented)
spring-boot: v1.42.0
Test_Config_LogInjection_128Bit_TraceId_Default: missing_feature (disabled by default)
Test_Config_LogInjection_128Bit_TraceId_Disabled: incomplete_test_app (weblog endpoint not implemented)
Test_Config_LogInjection_128Bit_TraceId_Default:
'*': incomplete_test_app (weblog endpoint not implemented)
'spring-boot-3-native': missing_feature
Comment on lines +1827 to +1828
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we planning to enable the 128bit logging tests in this PR?

Suggested change
'*': incomplete_test_app (weblog endpoint not implemented)
'spring-boot-3-native': missing_feature
'*': incomplete_test_app (weblog endpoint not implemented)
'spring-boot-3-native': v1.48.0.dev

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh we could do it like this, but I was going open a new PR to enable all tests together anyways. This was just to update the manifests to help Java CI pass

Test_Config_LogInjection_128Bit_TraceId_Disabled:
'*': incomplete_test_app (weblog endpoint not implemented)
'spring-boot-3-native': missing_feature
Test_Config_LogInjection_Default:
'*': incomplete_test_app (weblog endpoint not implemented)
'spring-boot-3-native': missing_feature
Expand Down
2 changes: 1 addition & 1 deletion tests/parametric/test_config_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def test_dogstatsd_custom_port(self, library_env, test_agent, test_library):
"dd_runtime_metrics_enabled": "false" if context.library != "java" else "true",
"dd_profiling_enabled": "false",
"dd_data_streams_enabled": "false",
"dd_logs_injection": "false" if context.library != "java" else "true",
"dd_logs_injection": "false",
}


Expand Down
9 changes: 5 additions & 4 deletions tests/test_config_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,6 @@ def test_log_injection_enabled(self):
msg = parse_log_injection_message(self.message)
assert msg is not None, "Log message with trace context not found"

# dd-trace-java stores injected trace information under the "mdc" key
if context.library.library == "java":
msg = msg.get("mdc")

tid = parse_log_trace_id(msg)
assert tid is not None, "Expected a trace ID, but got None"
sid = parse_log_span_id(msg)
Expand Down Expand Up @@ -558,6 +554,7 @@ def setup_log_injection_128bit_traceid_default(self):
def test_log_injection_128bit_traceid_default(self):
assert self.r.status_code == 200
log_msg = parse_log_injection_message(self.message)

trace_id = parse_log_trace_id(log_msg)
assert re.match(r"^[0-9a-f]{32}$", trace_id), f"Invalid 128-bit trace_id: {trace_id}"

Expand All @@ -575,6 +572,7 @@ def setup_log_injection_128bit_traceid_disabled(self):
def test_log_injection_128bit_traceid_disabled(self):
assert self.r.status_code == 200
log_msg = parse_log_injection_message(self.message)

trace_id = parse_log_trace_id(log_msg)
assert re.match(r"^\d{1,20}$", str(trace_id)), f"Invalid 64-bit trace_id: {trace_id}"

Expand Down Expand Up @@ -695,6 +693,9 @@ def parse_log_injection_message(log_message):
continue
if message.get("dd"):
return message.get("dd")
# dd-trace-java stores injected trace information under the "mdc" key
if context.library.library == "java":
message = message.get("mdc")
return message
return None

Expand Down