Skip to content

[php] Enable v1 payload tests, and make trace assertions format-agnostic - #7843

Draft
Leiyks wants to merge 3 commits into
mainfrom
leiyks/php-v1-payload
Draft

Leiyks wants to merge 3 commits into
mainfrom
leiyks/php-v1-payload

Conversation

@Leiyks

@Leiyks Leiyks commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

dd-trace-php is moving to the v1 trace payload by default (DataDog/dd-trace-php#4046). Enabling the v1 tests for PHP surfaced assertions that only work with the v0.4 shape and validators that silently skip /v1.0/traces payloads.

Changes

  • manifests/php.yml: enable tests/test_v1_payloads.py from v1.26.0-dev (Test_V1SpanLinks stays missing_feature: PHP creates no link from conflicting contexts). Enable 5 span link/event parametric tests from v1.26.0-dev and split the file-level missing_feature of test_span_events.py / test_span_links.py into per-test declarations. Mark test_tags_defaults_sst002 as bug (APMAPI-1545): the test agent drops sampling mechanism 0 from v1 chunks.
  • PHP weblogs (plain, laravel11x, symfony7x): add /add_event (a span.event on the root span), needed by Test_V1SpanEvents.
  • Format-agnostic assertions: read the sampling priority with get_sampling_priority() and the span kind with get_span_kind(), accept typed booleans in test_otel_api_interoperability, and stop asserting that only one span carries _dd.git.* in Test_TracerSCITagging (v1 sends them as payload attributes).
  • Validators that skipped v1 now check it: Test_TraceHeaders (counts chunks on /v1.0/traces), Test_Agent::test_agent_do_not_drop_traces and Test_SamplingDeterminism.

Merge order

A master build and the v1 branch both report 1.26.0+dev.<sha>, so the version gate can't tell them apart: land this after (or with) DataDog/dd-trace-php#4046. If that misses 1.26.0, move the gate to the next minor.

CI also needs a test-agent release containing DataDog/dd-apm-test-agent#422 (v1 array/kvlist attribute flattening) and a pin bump; until then the 5 newly enabled span link/event tests fail.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

utils/build/docker/php/weblogs/plain/add_event.php                      @DataDog/system-tests-reviewers
manifests/php.yml                                                       @DataDog/system-tests-reviewers
tests/appsec/api_security/test_endpoints.py                             @DataDog/asm-libraries
tests/appsec/test_automated_payment_events.py                           @DataDog/asm-libraries
tests/appsec/test_trace_tagging.py                                      @DataDog/asm-libraries
tests/integrations/test_db_integrations_sql.py                          @DataDog/system-tests-reviewers
tests/parametric/test_otel_api_interoperability.py                      @DataDog/system-tests-reviewers
tests/parametric/test_tracer.py                                         @DataDog/system-tests-reviewers
tests/test_data_integrity.py                                            @DataDog/system-tests-reviewers
tests/test_sampling_rates.py                                            @DataDog/system-tests-reviewers
utils/build/docker/php/common/rewrite-rules.conf                        @DataDog/system-tests-reviewers
utils/build/docker/php/weblogs/laravel11x/routes/web.php                @DataDog/system-tests-reviewers
utils/build/docker/php/weblogs/symfony7x/src/Controller/AppController.php  @DataDog/system-tests-reviewers
utils/dd_types/_datadog_library_trace.py                                @DataDog/system-tests-core
utils/interfaces/_library/core.py                                       @DataDog/system-tests-core

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

✨ Unblock PR with BitsAI

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 310 Pipeline jobs failed

Testing the test | System Tests (php, dev) / parametric / parametric (1) — ❌ 1 test failed · 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

❌ tests.parametric.test_otel_span_methods.Test_Otel_Span_Methods.test_otel_span_link_attribute_handling[library_env0, parametric-php] from system_tests_suite
AssertionError: assert 4 == 8
 &#43;  where 4 = len({&#39;array&#39;: [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;], &#39;bools&#39;: [True, False], &#39;foo&#39;: &#39;bar&#39;, &#39;nested&#39;: [1, 2]})
 &#43;    where {&#39;array&#39;: [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;], &#39;bools&#39;: [True, False], &#39;foo&#39;: &#39;bar&#39;, &#39;nested&#39;: [1, 2]} = &lt;built-in method get of dict object at 0x7f4878133640&gt;(&#39;attributes&#39;)
 &#43;      where &lt;built-in method get of dict object at 0x7f4878133640&gt; = {&#39;attributes&#39;: {&#39;array&#39;: [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;], &#39;bools&#39;: [True, False], &#39;foo&#39;: &#39;bar&#39;, &#39;nested&#39;: [1, 2]}, &#39;flags&#39;: 0, &#39;span_id&#39;: 5673861124757673576, &#39;trace_id&#39;: 5673861124757673576, ...}.get

self = &lt;tests.parametric.test_otel_span_methods.Test_Otel_Span_Methods object at 0x7f48a8342210&gt;
test_agent = &lt;utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7f48776bc080&gt;
test_library = &lt;utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7f487801b7d0&gt;

    def test_otel_span_link_attribute_handling(self, test_agent: TestAgentAPI, test_library: APMLibrary):
...
Testing the test | System Tests (php, dev) / parametric / parametric (2) — ❌ 4 tests failed · 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

❌ tests.parametric.test_span_events.Test_Span_Events.test_span_with_event_v04[library_env0, parametric-php] from system_tests_suite
KeyError: &#39;span_events&#39;

self = &lt;tests.parametric.test_span_events.Test_Span_Events object at 0x7f04491004d0&gt;
library_env = {&#39;DD_TRACE_API_VERSION&#39;: &#39;v0.4&#39;, &#39;DD_TRACE_NATIVE_SPAN_EVENTS&#39;: &#39;1&#39;}
test_agent = &lt;utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7f047c5071a0&gt;
test_library = &lt;utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7f0448519100&gt;

    @pytest.mark.parametrize(&#34;library_env&#34;, [{&#34;DD_TRACE_API_VERSION&#34;: &#34;v0.4&#34;, &#34;DD_TRACE_NATIVE_SPAN_EVENTS&#34;: &#34;1&#34;}])
    def test_span_with_event_v04(self, library_env: dict[str, str], test_agent: TestAgentAPI, test_library: APMLibrary):
        &#34;&#34;&#34;Test adding a span event in the v0.4 format, which support the native attribute representation.&#34;&#34;&#34;
...
❌ tests.parametric.test_span_events.Test_Span_Events.test_span_with_event_v07[library_env0, parametric-php] from system_tests_suite
KeyError: &#39;span_events&#39;

self = &lt;tests.parametric.test_span_events.Test_Span_Events object at 0x7fe5944c7350&gt;
library_env = {&#39;DD_TRACE_API_VERSION&#39;: &#39;v0.7&#39;, &#39;DD_TRACE_NATIVE_SPAN_EVENTS&#39;: &#39;1&#39;}
test_agent = &lt;utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7fe5935df290&gt;
test_library = &lt;utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7fe593c81910&gt;

    @pytest.mark.parametrize(&#34;library_env&#34;, [{&#34;DD_TRACE_API_VERSION&#34;: &#34;v0.7&#34;, &#34;DD_TRACE_NATIVE_SPAN_EVENTS&#34;: &#34;1&#34;}])
    def test_span_with_event_v07(self, library_env: dict[str, str], test_agent: TestAgentAPI, test_library: APMLibrary):
        &#34;&#34;&#34;Test adding a span event in the v0.7 format, which support the native attribute representation.&#34;&#34;&#34;
...
❌ tests.parametric.test_span_links.Test_Span_Links.test_span_started_with_link_v04[library_env0, parametric-php] from system_tests_suite
KeyError: &#39;span_links&#39;

self = &lt;tests.parametric.test_span_links.Test_Span_Links object at 0x7f0449101ac0&gt;
test_agent = &lt;utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7f047c5071a0&gt;
test_library = &lt;utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7f044852c290&gt;

    @pytest.mark.parametrize(&#34;library_env&#34;, [{&#34;DD_TRACE_API_VERSION&#34;: &#34;v0.4&#34;}])
    def test_span_started_with_link_v04(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        &#34;&#34;&#34;Test adding a span link created from another span and serialized in the expected v0.4 format.
        This tests the functionality of &#34;create a direct link between two spans
...
↳ and 1 more — View all
DataDog/system-tests | build_base_images — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

View all 310 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 927ada5 | Docs | View more details | Give us feedback!

Leiyks added a commit to DataDog/dd-trace-php that referenced this pull request Sep 28, 2026
…merge

Clone system-tests at SYSTEM_TESTS_REF (default leiyks/php-v1-payload,
DataDog/system-tests#7843) from SYSTEM_TESTS_REPO, and add
APM_TRACING_EFFICIENT_PAYLOAD to the System Tests matrix.
Leiyks added a commit to DataDog/dd-trace-php that referenced this pull request Sep 29, 2026
…merge

Clone system-tests at SYSTEM_TESTS_REF (default leiyks/php-v1-payload,
DataDog/system-tests#7843) from SYSTEM_TESTS_REPO, and add
APM_TRACING_EFFICIENT_PAYLOAD to the System Tests matrix.
Leiyks added 2 commits October 1, 2026 17:37
- Read the sampling priority through get_sampling_priority() in the appsec
  payment, trace tagging and LLM endpoint tests: v1 carries it on the chunk.
- Check span.kind on agent spans through get_span_kind() in the SQL tests:
  the agent reports it as a top-level enum in idxTracerPayloads.
- Test_TraceHeaders, Test_Agent::test_agent_do_not_drop_traces and
  Test_SamplingDeterminism silently skipped /v1.0/traces payloads; make them
  format-agnostic so they cover v1 too.
- Accept typed v1 booleans in test_set_attribute_from_otel.
- Make Test_TracerSCITagging format-agnostic: v1 git tags are payload-level.
- Run tests/test_v1_payloads.py and the span link/event parametric tests that pass with the v1 payload on v1.26.0-dev; keep the rest missing_feature.
- Declare test_tags_defaults_sst002 as bug (APMAPI-1545) on v1.26.0-dev.
- Add the /add_event endpoint to the plain, laravel11x and symfony7x weblogs.
Leiyks added a commit to DataDog/dd-trace-php that referenced this pull request Oct 1, 2026
…merge

Clone system-tests at SYSTEM_TESTS_REF (default leiyks/php-v1-payload,
DataDog/system-tests#7843) from SYSTEM_TESTS_REPO, and add
APM_TRACING_EFFICIENT_PAYLOAD to the System Tests matrix.
@Leiyks
Leiyks force-pushed the leiyks/php-v1-payload branch from f45dffb to 6080697 Compare October 1, 2026 16:57
Leiyks added a commit to DataDog/dd-trace-php that referenced this pull request Oct 1, 2026
…merge

Clone system-tests at SYSTEM_TESTS_REF (default leiyks/php-v1-payload,
DataDog/system-tests#7843) from SYSTEM_TESTS_REPO, and add
APM_TRACING_EFFICIENT_PAYLOAD to the System Tests matrix.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant