Conversation
|
|
|
✨ Fix all issues with BitsAI or with Cursor
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36e644ab99
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| assert len(spans_with_links) >= 1, "Expected at least one span with span links" | ||
|
|
||
| link_carrier = spans_with_links[0] | ||
| links = link_carrier.raw_span.get("span_links") or [] |
There was a problem hiding this comment.
Parse attribute-backed span links before asserting fields
This test collects spans when links are present either in span_links or in attributes._dd.span_links, but then it reads links only from span_links. In runs where the tracer reports links through _dd.span_links (which is already treated as a valid v1 representation elsewhere, e.g. tests/test_distributed.py), spans_with_links will be non-empty but links becomes [], causing a false failure on assert len(links) >= 1 even though links were present.
Useful? React with 👍 / 👎.
|
|
||
| def test_root_span_is_top_level(self): | ||
| """The root span of a trace must be marked as top-level""" | ||
| for _, root_span in interfaces.library.get_root_spans(self.r): |
There was a problem hiding this comment.
Require at least one root span in top-level validation
The test iterates over interfaces.library.get_root_spans(self.r) without first asserting that any root span was found. If trace correlation fails or no root span is captured for that request, the loop body never executes and the test passes vacuously, so regressions in _dd.top_level tagging can be missed.
Useful? React with 👍 / 👎.
nccatoni
left a comment
There was a problem hiding this comment.
LGTM (for @DataDog/system-tests-core) but you should get a review from someone familiar with the feature
Motivation
Closes coverage gaps identified in the V1 trace payload coverage report. The V1 (
/v1.0/traces) format introduced indexed string tables, typedAnyValueattributes, and top-level span links/events. Several attribute types and span-level fields had no test coverage at any layer.I had to add span event support to the orchestrion weblog, which might be the wrong move here? In which case let me know go team and I can either adjust the implementation or just mark this test as skipped for the orchestrion weblog
Changes
utils/proxy/traces/trace_v1.py_uncompress_key_value_list()to recursively resolvekeyValueList(type 7) AnyValue attributes — the only AnyValue variant that was completely unhandled by the deserializer._attributes_to_dict()so type-7 attributes deserialize to a nesteddictinstead of being passed through raw.tests/test_the_test/test_deserializer.pytest_deserialize_v1_trace_key_value_list_attribute: unit test verifying that akeyValueList-typed span attribute round-trips correctly through the Python deserializer. Includes a# TODO(v1-kvlist-e2e)tracking comment for the future E2E test once a tracer emits this type.tests/test_v1_payloads.py— three new E2E test classes, all under@scenarios.apm_tracing_efficient_payload:Test_V1SpanLinks: injects conflicting W3C + Datadog trace context via/make_distant_callto force span link creation, then asserts the deserialized link has a hextrace_idand integerspan_id.Test_V1SpanEvents: calls/add_eventand asserts the root span carries at least one event withtime_unix_nanoandnamefields in the deserialized V1 form.Test_V1TopLevelSpans: calls/status?code=200and asserts every root span has_dd.top_level=1in its V1attributesmap (required for correct agent-side priority sampling).Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present