Skip to content

chore(tests): declare contrib environments in suitespec - #20012

Open
mabdinur wants to merge 19 commits into
mainfrom
codex/declare-all-suitespec
Open

chore(tests): declare contrib environments in suitespec#20012
mabdinur wants to merge 19 commits into
mainfrom
codex/declare-all-suitespec

Conversation

@mabdinur

@mabdinur mabdinur commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Declare every contrib test environment in tests/contrib/suitespec.yml and select those environments for uv execution. Riot remains the compatibility baseline during this stage, and the existing .riot/requirements/*.txt lockfiles are reused.

Review this first

test_suitespec_matches_riot is the contract for the large YAML change. It expands the suitespec and Riot definitions, then compares each resulting environment by:

  • environment name and Python version
  • tokenized test command
  • direct dependency constraints
  • environment variables
  • lockfile identity and existence

Dependencies and environment variables are compared as sets, so ordering-only YAML changes do not create noise. Commands remain exact.

This test means reviewers do not need to manually compare 91 suites against riotfile.py. Review the comparison rules first, then focus on the two riot_lock_dependencies overrides. Those overrides preserve historical Riot lock hashes where uv needs a different install declaration.

Ray and Bottle use definitions that work under both runners: Ray workers retain the prepared environment, and Bottle invokes pytest as a module to avoid executable-path shadowing.

Testing

  • test_suitespec_matches_riot
  • Bottle uv environment: 55 tests passed
  • full repository lint
  • GitLab contrib matrix as the runtime validation

Risks

This switches contrib jobs to uv. The parity test prevents configuration drift; CI covers runner-specific runtime behavior.

Additional Notes

@mabdinur mabdinur added the changelog/no-changelog A changelog entry is not required for this PR. label Sep 1, 2026
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codeowners resolved as

Resolved from the full PR diff against main using the target branch CODEOWNERS file.
CODEOWNERS team requests not listed below are not required by the current file set.

.gitlab/tests.yml                                                       @DataDog/python-guild @DataDog/apm-core-python
riotfile.py                                                             @DataDog/apm-python
scripts/gen_gitlab_config.py                                            @DataDog/python-guild
scripts/run-tests                                                       @DataDog/python-guild
tests/contrib/integration_registry/test_riotfile.py                     @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/suitespec.yml                                             @DataDog/python-guild
tests/internal/test_gen_gitlab_config.py                                @DataDog/apm-core-python
tests/suitespec.py                                                      @DataDog/python-guild @DataDog/apm-core-python

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Sep 1, 2026

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

There are 3 circular imports that already exist on the base branch and have not been changed by this PR.

ddtrace.llmobs -> ddtrace.llmobs._evaluators -> ddtrace.llmobs._evaluators.format -> ddtrace.llmobs._experiment -> ddtrace.llmobs
ddtrace.errortracking._handled_exceptions.bytecode_injector -> ddtrace.errortracking._handled_exceptions.callbacks -> ddtrace.errortracking._handled_exceptions.collector -> ddtrace.errortracking._handled_exceptions.bytecode_reporting -> ddtrace.errortracking._handled_exceptions.bytecode_injector
ddtrace.appsec._asm_request_context -> ddtrace.appsec._iast._iast_request_context_base -> ddtrace.appsec._iast._iast_env -> ddtrace.appsec._iast.reporter -> ddtrace.appsec._exploit_prevention.stack_traces -> ddtrace.appsec._asm_request_context

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Sep 1, 2026

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

There are 230 dependency direction violations that already exist on the base branch and have not been changed by this PR.

Show existing violations (showing 5 of 230 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=134)
ddtrace.appsec._listeners -×-> ddtrace.trace  (product:appsec -> product:tracing, score=132)
ddtrace.llmobs._telemetry -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=132)
ddtrace.internal.opentelemetry.context -×-> ddtrace.trace  (product:opentelemetry -> product:tracing, score=132)
ddtrace.profiling.collector.pytorch -×-> ddtrace.trace  (product:profiling -> product:tracing, score=132)

To see all violations, download the layers-base.json and layers-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/layers.py compare layers-base.json layers-pr.json

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Tests

⚠️ Warnings

⚠️ Your PR has warnings. Please review the issues below.

❄️ 1 New flaky test detected

test_suitespec_matches_riot[py3.13] from test_riotfile.py
uv environments missing from Riot: {('grpc:grpc_aio', '3.10', ('python', '-m', 'pytest', '{cmdargs}', 'tests/contrib/grpc_aio'), frozenset({'pytest-asyncio==0.23.7', 'googleapis-common-protos', 'pytest-cov', 'pytest-mock', 'pytest', 'mock', 'coverage', 'grpcio~=1.59.0', 'hypothesis<6.45.1', 'pytest-randomly', 'opentracing'}), frozenset({('DD_INJECT_FORCE', '1'), ('_DD_TRACE_GRPC_AIO_ENABLED', 'true'), ('_CI_DD_TAGS', 'test.configuration.riot_hash:1591bf5,test.configuration.python:3.10'), ('_DD_CIVISIBILITY_OUT_OF_SESSION_RETRIES_ENABLED', '1'), ('CARGO_BUILD_JOBS', '12'), ('DD_CODE_ORIGIN_FOR_SPANS_ENABLED', 'false'), ('DD_REMOTE_CONFIGURATION_ENABLED', 'false'), ('DD_PATCH_MODULES', 'unittest:false'), ('DD_TESTING_RAISE', '1'), ('DD_CIVISIBILITY_BACKEND_API_TIMEOUT_MILLIS', '2000'), ('_DD_CIVISIBILITY_USE_CI_CONTEXT_PROVIDER', '1'), ('DD_TRACE_COMPUTE_STATS', 'false'), ('CMAKE_BUILD_PARALLEL_LEVEL', '12'), ('DD_INJECTION_ENABLED', '1')})), ('azure_functions:cosmos', '3.12', ('pytest', '{cmdargs}', 'tests/contrib/azure_functions_cosmos'), frozenset({'pytest-cov', 'pytest-mock', 'pytest', 'mock', 'azure.storage.blob', 'coverage', 'aiohttp', 'hypothesis<6.45.1', 'azure.functions~=1.10.1', 'opentracing', 'azure.cosmos'}), frozenset({('DD_INJECT_FORCE', '1'), ('_DD_CIVISIBILITY_OUT_OF_SESSION_RETRIES_ENABLED', '1'), ('DD_TRACE_PY_ENABLE_ITR_TEST_SKIPPING_FOR_JOB', 'true'), ('CARGO_BUILD_JOBS', '12'), ('DD_CODE_ORIGIN_FOR_SPANS_ENABLED', 'false'), ('DD_REMOTE_CONFIGURATION_ENABLED', 'false'), ('DD_PATCH_MODULES', 'unittest:false'), ('_CI_DD_TAGS', 'test.configuration.riot_hash:16a6e70,test.configuration.python:3.12'), ('DD_CIVISIBILITY_ITR_ENABLED', 'true'), ('_DD_CIVISIBILITY_ITR_PREVENT_TEST_SKIPPING', '0'), ('DD_TESTING_RAISE', '1'), ('DD_CIVISIBILITY_BACKEND_API_TIMEOUT_MILLIS', '2000'), ('_DD_CIVISIBILITY_USE_CI_CONTEXT_PROVIDER', '1'), ('DD_TRACE_COMPUTE_STATS', 'false'), ('CMAKE_BUILD_PARALLEL_LEVEL', '12'), ('DD_INJECTION_ENABLED', '1')})), ('psycopg:psycopg2', '3.9', ('pytest', '{cmdargs}', 'tests/contrib/psycopg2'), frozenset({'pytest-cov', 'pytest-mock', 'pytest', 'psycopg2-binary', 'mock', 'coverage', 'hypothesis<6.45.1', 'pytest-randomly', 'opentracing'}), frozenset({('DD_INJECT_FORCE', '1'), ('_CI_DD_TAGS', 'test.configuration.riot_hash:1d07c9f,test.configuration.python:3.9'), ('_DD_CIVISIBILITY_OUT_OF_SESSION_RETRIES_ENABLED', '1'), ('CARGO_BUILD_JOBS', '12'), ('DD_CODE_ORIGIN_FOR_SPANS_ENABLED', 'false'), ('DD_REMOTE_CONFIGURATION_ENABLED', 'false'), ('DD_PATCH_MODULES', 'unittest:false'), ('DD_TESTING_RAISE', '1'), ('DD_CIVISIBILITY_BACKEND_API_TIMEOUT_MILLIS', '2000'), ('_DD_CIVISIBILITY_USE_CI_CONTEXT_PROVIDER', '1'), ('DD_TRACE_COMPUTE_STATS', 'false'), ('CMAKE_BUILD_PARALLEL_LEVEL', '12'), ('DD_INJECTION_ENABLED', '1')})), ('elasticsearch:opensearch', '3.9', ('pytest', '{cmdargs}', 'tests/contrib/elasticsearch/test_opensearch.py', '-k', 'not ElasticsearchPatchTest'), frozenset({'pytest-cov', 'pytest-mock', 'pytest', 'mock', 'coverage', 'opensearch-py[requests]~=1.1.0', 'hypothesis<6.45.1', 'pytest-randomly', 'opentracing'}), frozenset({('DD_INJECT_FORCE', '1'), ('_DD_CIVISIBILITY_OUT_OF_SESSION_RETRIES_ENABLED', '1'), ('CARGO_BUILD_JOBS', '12'), ('DD_CODE_ORIGIN_FOR_SPANS_ENABLED', 'false'), ('DD_REMOTE_CONFIGURATION_ENABLED', 'false'), ('DD_PATCH_MODULES', 'unittest:false'), ('DD_TESTING_RAISE', '1'), ('DD_CIVISIBILITY_BACKEND_API_TIMEOUT_MILLIS', '2000'), ('_DD_CIVISIBILITY_USE_CI_CONTEXT_PROVIDER', '1'), ('DD_TRACE_COMPUTE_STATS', 'false'), ('CMAKE_BUILD_PARALLEL_LEVEL', '12'), ('_CI_DD_TAGS', 'test.configuration.riot_hash:10853b3,test.configuration.python:3.9'), ('DD_INJECTION_ENABLED', '1')})), ('graphql:graphene', '3.11', ('pytest', '{cmdargs}', 'tests/contrib/graphene'), frozenset({'graphene~=3.0.0', 'pytest-cov', 'pytest-mock', 'pytest', 'graphql-relay', 'pytest-asyncio==0.21.1', 'mock', 'coverage', 'hypothesis<6.45.1', 'pytest-randomly', 'opentracing'}), frozenset({('DD_INJECT_FORCE', '1'), ('_CI_DD_TAGS', 'test.configuration.riot_hash:b5e9131,test.configuration.python:3.11'), ('_DD_CIVISIBILITY_OUT_OF_SESSION_RETRIES_ENABLED', '1'), ('CARGO_BUILD_JOBS', '12'), ('DD_CODE_ORIGIN_FOR_SPANS_ENABLED', 'false'), ('DD_REMOTE_CONFIGURATION_ENABLED', 'false'), ('DD_PATCH_MODULES', 'unittest:false'), ('DD_TESTING_RAISE', '1'), ('DD_CIVISIBILITY_BACKEND_API_TIMEOUT_MILLIS', '2000'), ('_DD_CIVISIBILITY_USE_CI_CONTEXT_PROVIDER', '1'), ('DD_TRACE_COMPUTE_STATS', 'false'), ('CMAKE_BUILD_PARALLEL_LEVEL', '12'), ('DD_INJECTION_ENABLED', '1')})), ('django:djangorestframework', '3.13', ('pytest', '-n', '8', '--dist=worksteal', '{cmdargs}', 'tests/contrib/djangorestframework'), frozenset({'pytest-cov', 'pytest-mock', 'pytest', 'mock', 'pytest-xdist', 'coverage', 'django~=4.0', 'hypothesis<6.45.1', 'djangorestframework', 'pytest-randomly', 'opentracing', 'pytest-django[testing]==3.10.0'}), frozenset({('DD_INJECT_FORCE', '1'), ('_CI_DD_TAGS', 'test.configuration.riot_hash:1ea0ab7,test.configuration.pyth

View in Flaky Test Management

ℹ️ Info

No other issues found (see more)

🧪 All tests passed

Useful? React with 👍 / 👎

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

@pr-commenter

pr-commenter Bot commented Sep 1, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-03 20:05:17

Comparing candidate commit 24789ee in PR branch codex/declare-all-suitespec with baseline commit 6a7d079 in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 7 performance regressions! Performance is the same for 579 metrics, 10 unstable metrics, 2 known flaky benchmarks, 16 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:httppropagationinject-ids_only

  • 🟥 execution_time [+2.803µs; +2.952µs] or [+16.629%; +17.512%]

scenario:iastaspects-strip_aspect

  • 🟥 execution_time [+43.579µs; +51.783µs] or [+14.669%; +17.431%]

scenario:iastaspects-title_aspect

  • 🟥 execution_time [+41.468µs; +51.647µs] or [+15.370%; +19.142%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+113.434µs; +120.683µs] or [+27.056%; +28.784%]

scenario:otelspan-start

  • 🟥 execution_time [+2.190ms; +3.209ms] or [+7.005%; +10.264%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+640.251ns; +671.227ns] or [+23.826%; +24.979%]

scenario:tracer-small

  • 🟥 execution_time [+33.633µs; +35.629µs] or [+9.858%; +10.443%]

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:coreapiscenario-context_with_data_listeners

  • unstable execution_time [-783.327ns; +733.118ns] or [-6.932%; +6.487%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-29.549ns; +37.220ns] or [-4.824%; +6.077%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1610.941ns; +1762.535ns] or [-9.293%; +10.167%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1271.146ns; +1287.222ns] or [-9.495%; +9.615%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-323.027ns; +343.195ns] or [-8.663%; +9.204%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-263.533ns; +260.030ns] or [-8.824%; +8.707%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-68.941ns; +79.360ns] or [-6.066%; +6.983%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-3874.543ns; +4029.840ns] or [-9.506%; +9.887%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-776.194ns; +774.558ns] or [-9.577%; +9.557%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-56.165µs; +53.794µs] or [-9.743%; +9.332%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:iastaspects-casefold_noaspect

  • 🟥 execution_time [+25.724µs; +34.986µs] or [+9.850%; +13.396%]

scenario:span-start

  • 🟥 execution_time [+1.723ms; +1.894ms] or [+12.003%; +13.194%]

Known flaky benchmarks without significant changes:

  • scenario:errortrackingflasksqli-baseline
  • scenario:flasksimple-iast-get
  • scenario:iastaspects-casefold_aspect
  • scenario:iastaspects-index_aspect
  • scenario:iastaspects-ljust_noaspect
  • scenario:iastaspects-lower_aspect
  • scenario:iastaspects-replace_aspect
  • scenario:iastaspects-swapcase_aspect
  • scenario:iastaspects-title_noaspect
  • scenario:iastaspects-translate_aspect
  • scenario:iastaspects-translate_noaspect
  • scenario:iastaspects-upper_noaspect
  • scenario:packagespackageforrootmodulemapping-cache_off
  • scenario:packagespackageforrootmodulemapping-cache_on
  • scenario:sethttpmeta-all-enabled
  • scenario:telemetryaddmetric-record-100-metrics

Base automatically changed from codex/run-tracer-with-uv to main September 2, 2026 15:56
@mabdinur
mabdinur force-pushed the codex/declare-all-suitespec branch from 3386a06 to d0f8530 Compare September 2, 2026 20:58
@mabdinur
mabdinur marked this pull request as ready for review September 2, 2026 21:01
@mabdinur
mabdinur requested review from a team as code owners September 2, 2026 21:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T21:11:58.335305Z d0f8530 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0f85304a0

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/suitespec.py
Comment thread tests/contrib/integration_registry/test_riotfile.py Outdated
Comment thread tests/suitespec.py
@mabdinur
mabdinur force-pushed the codex/declare-all-suitespec branch from f5e4a21 to 3a1006e Compare September 3, 2026 15:35
@mabdinur
mabdinur requested a review from a team as a code owner September 3, 2026 15:35
@mabdinur
mabdinur force-pushed the codex/declare-all-suitespec branch from 9fb9ca3 to 1ff7575 Compare September 3, 2026 16:49
Comment thread scripts/gen_gitlab_config.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog A changelog entry is not required for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant