ci: dogfood ddtest across riot test suites - #19870
Conversation
Codeowners resolved asResolved from the full PR diff against No remaining files require a CODEOWNERS review. |
Circular import analysis
|
Dependency direction analysis
|
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 49780db | Docs | View more details | Give us feedback! |
BenchmarksBenchmark execution time: 2026-09-03 14:35:21 Comparing candidate commit 49780db in PR branch Found 0 performance improvements and 6 performance regressions! Performance is the same for 580 metrics, 10 unstable metrics, 2 known flaky benchmarks, 16 flaky benchmarks without significant changes.
|
7267505 to
7ae1d3f
Compare
|
@DataDog review |
There was a problem hiding this comment.
The ddtest switch does not keep each suite's discovery path or pytest selection. Matrix needs also combine plan artifacts from unrelated riot hashes, so some new jobs can skip required tests or use a plan for another environment.
🤖 Datadog Autotest · Commit 0f9bff1 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
## Summary Stacked follow-up to #19870 that removes the standalone `scripts/ddtest-infer-service` helper while preserving the pre-import service override that ddtest requires. ## Changes - Add explicit `ddtest_service` values to every ddtest-enabled suite in `tests/suitespec.yml`, `tests/contrib/suitespec.yml`, `tests/llmobs/suitespec.yml`, and `tests/appsec/suitespec.yml`. - Have `scripts/gen_gitlab_config.py` require the metadata and emit `_DD_PYTEST_XDIST_INFERRED_SERVICE` directly on each generated ddtest run job. - Remove the shell command substitution and delete `scripts/ddtest-infer-service`. - Add generator coverage for the emitted service variable. This keeps the variable available before Riot starts pytest, when the controller imports ddtrace, while making the expected suite-level service visible and reviewable in suitespec instead of reimplementing package discovery in a shell helper. ## Testing - `scripts/lint suitespec-check` - `scripts/gen_gitlab_config.py` - `scripts/run-tests -s --venv 1c8641e -- -- tests/internal/test_gen_gitlab_config.py` (12 passed) No customer-facing changelog is required.
|
@DataDog review |
There was a problem hiding this comment.
More details
The specialist candidate refers to a file that this PR does not change. The effective three-dot diff has no reportable finding.
🤖 Datadog Autotest · Commit 2b40758 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
Add ddtest: true to appsec_threats_fastapi_iast (tests/appsec/suitespec.yml) and mistralai (tests/llmobs/suitespec.yml), with corresponding riotfile.py changes (DDTEST_SUITE_PATH, DDTEST_TESTS_LOCATION, command placeholders). appsec_threats_fastapi_iast also adds: - DDTEST_PYTEST_ADDOPTS: -k 'Test_FastAPI and not Test_FastAPI_RC' to exclude the RC test class (which needs DD_REMOTE_CONFIGURATION_ENABLED=true, handled by the dedicated appsec_threats_fastapi_rc suite). - services: [testagent] for snapshot comparison. - env: _DD_PYTEST_XDIST_INFERRED_SERVICE for stable service inference. Split from #19870 to isolate CODEOWNER approvals.
Add ddtest: true to appsec_threats_fastapi_iast (tests/appsec/suitespec.yml) and mistralai (tests/llmobs/suitespec.yml), with corresponding riotfile.py changes (DDTEST_SUITE_PATH, DDTEST_TESTS_LOCATION, command placeholders). appsec_threats_fastapi_iast also adds: - DDTEST_PYTEST_ADDOPTS: -k 'Test_FastAPI and not Test_FastAPI_RC' to exclude the RC test class (which needs DD_REMOTE_CONFIGURATION_ENABLED=true, handled by the dedicated appsec_threats_fastapi_rc suite). - services: [testagent] for snapshot comparison. - env: _DD_PYTEST_XDIST_INFERRED_SERVICE for stable service inference. Split from #19870 to isolate CODEOWNER approvals.
Add ddtest: true (ddtest_nodes: 2) to appsec_integrations_django (tests/appsec/suitespec.yml) and profile (tests/profiling/suitespec.yml) suites, with corresponding riotfile.py changes (DDTEST_SUITE_PATH, DDTEST_TESTS_LOCATION, command placeholders). Split from #19870 to isolate CODEOWNER approvals.
Add ddtest: true to appsec_threats_fastapi_iast (tests/appsec/suitespec.yml) and mistralai (tests/llmobs/suitespec.yml), with corresponding riotfile.py changes (DDTEST_SUITE_PATH, DDTEST_TESTS_LOCATION, command placeholders). appsec_threats_fastapi_iast also adds: - DDTEST_PYTEST_ADDOPTS: -k 'Test_FastAPI and not Test_FastAPI_RC' to exclude the RC test class (which needs DD_REMOTE_CONFIGURATION_ENABLED=true, handled by the dedicated appsec_threats_fastapi_rc suite). - services: [testagent] for snapshot comparison. - env: _DD_PYTEST_XDIST_INFERRED_SERVICE for stable service inference. Split from #19870 to isolate CODEOWNER approvals.
Add ddtest: true (ddtest_nodes: 2) to appsec_integrations_django (tests/appsec/suitespec.yml) and profile (tests/profiling/suitespec.yml) suites, with corresponding riotfile.py changes (DDTEST_SUITE_PATH, DDTEST_TESTS_LOCATION, command placeholders). Split from #19870 to isolate CODEOWNER approvals.
Add ddtest: true to appsec_threats_fastapi_iast (tests/appsec/suitespec.yml) and mistralai (tests/llmobs/suitespec.yml), with corresponding riotfile.py changes (DDTEST_SUITE_PATH, DDTEST_TESTS_LOCATION, command placeholders). appsec_threats_fastapi_iast also adds: - DDTEST_PYTEST_ADDOPTS: -k 'Test_FastAPI and not Test_FastAPI_RC' to exclude the RC test class (which needs DD_REMOTE_CONFIGURATION_ENABLED=true, handled by the dedicated appsec_threats_fastapi_rc suite). - services: [testagent] for snapshot comparison. - env: _DD_PYTEST_XDIST_INFERRED_SERVICE for stable service inference. Split from #19870 to isolate CODEOWNER approvals.
Add ddtest: true (ddtest_nodes: 2) to appsec_integrations_django (tests/appsec/suitespec.yml) and profile (tests/profiling/suitespec.yml) suites, with corresponding riotfile.py changes (DDTEST_SUITE_PATH, DDTEST_TESTS_LOCATION, command placeholders). Split from #19870 to isolate CODEOWNER approvals.
Add ddtest: true to appsec_threats_fastapi_iast (tests/appsec/suitespec.yml) and mistralai (tests/llmobs/suitespec.yml), with corresponding riotfile.py changes (DDTEST_SUITE_PATH, DDTEST_TESTS_LOCATION, command placeholders). appsec_threats_fastapi_iast also adds: - DDTEST_PYTEST_ADDOPTS: -k 'Test_FastAPI and not Test_FastAPI_RC' to exclude the RC test class (which needs DD_REMOTE_CONFIGURATION_ENABLED=true, handled by the dedicated appsec_threats_fastapi_rc suite). - services: [testagent] for snapshot comparison. - env: _DD_PYTEST_XDIST_INFERRED_SERVICE for stable service inference. Split from #19870 to isolate CODEOWNER approvals.
Add ddtest: true (ddtest_nodes: 2) to appsec_integrations_django (tests/appsec/suitespec.yml) and profile (tests/profiling/suitespec.yml) suites, with corresponding riotfile.py changes (DDTEST_SUITE_PATH, DDTEST_TESTS_LOCATION, command placeholders). Split from #19870 to isolate CODEOWNER approvals.
…gnufede/ddtest-dogfooding
…ding # Conflicts: # .gitlab/tests.yml # scripts/gen_gitlab_config.py
…gnufede/ddtest-dogfooding
78daa37 to
fa94b69
Compare
17524e9 to
30d176c
Compare
30d176c to
17524e9
Compare
|
/merge -f --reason "merge queue failing on unrelated jobs" |
|
View all feedbacks in Devflow UI.
PR already in the queue with status in_progress |
|
/merge -f --reason "merge queue failing on unrelated jobs" |
|
View all feedbacks in Devflow UI.
The expected merge time in
Warning This change was merged without running any pre merge CI checks Reason: merge queue failing on unrelated jobs |
## Description PR #19870 made the DDTest job generator select snapshot-specific templates whenever a suite uses `ddtest: true` and `snapshot: true`. For uv suites, it emits `.ddtest_base_uv_snapshot` and `.ddtest_run_uv_snapshot`, but #19870 only defined the non-snapshot uv templates. The bug remained hidden until #20034 migrated `integration_testagent` to a suitespec matrix. GitLab then rejected the generated child pipeline because `.ddtest_run_uv_snapshot` did not exist. No test jobs could start. The same issue would affect any future snapshot suite using both DDTest and uv. ## Fix - Define `.ddtest_base_uv_snapshot` by extending the existing `.test_base_uv_snapshot`. This reuses its Datadog Agent and test-agent services, test-agent URL setup, and project symlink. - Define `.ddtest_run_uv_snapshot` by extending `.ddtest_run_uv` and taking its services from the snapshot base. - Keep dependency installation and DDTest execution identical to the normal uv path. Only the snapshot test-agent setup is added. ## Testing - Generated `integration_testagent` jobs from the #20034 head with this commit applied. - GitLab CI lint accepted the complete generated child configuration. - All 17 generator tests passed on Python 3.12 through `scripts/run-tests`. - `scripts/lint checks` passed. ## Risks Low. Riot jobs and non-snapshot uv jobs are unchanged. The new templates are only selected for DDTest snapshot suites using uv. ## Additional Notes No customer-facing change. Co-authored-by: munir.abdinur <munir.abdinur@datadoghq.com>
Summary
Extend ddtest dogfooding from the standalone
internalpilot to opt-in riot test suites while preserving the existing two-stage plan/run CI design.The generated GitLab pipeline now discovers each matching riot venv, creates one plan job per suite that loops over its venv hashes, and fans out run jobs by venv and CI node. The jobs reuse the prebuilt base venvs and a shared ddtest build artifact.
Implementation
ddtest: truesuite metadata for the selected suites and validate that every matching riot venv declaresDDTEST_TESTS_LOCATION.gen_gitlab_config.pyto collect riot hashes, Python versions, test locations, and ddtest-specific pytest options, then emit the corresponding plan/run matrices.run --commandoverride to prepare and execute each selected venv, removing the customscripts/ddtest-riot.pybridge and its manual environment reconstruction.No ddtest source changes are included.
Testing
11 passed).Risks
Additional Notes
The implementation intentionally avoids per-venv base-venv rebuilds and keeps ddtest's plan/run responsibilities separate from Riot's venv lifecycle management.