Skip to content
Draft
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
167 changes: 162 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ default:
.is_release_branch: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+$/
.is_gh_merge_queue: $CI_COMMIT_BRANCH =~ /^gh-readonly-queue\/.*$/
.is_devflow_merge_queue: $CI_COMMIT_BRANCH =~ /^mq-working-branch-.*$/
.run_all_tests: '$FULL_TEST_SUITE == "true" || $NIGHTLY_BUILD == "true" || $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?$/ || $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+$/ || $CI_COMMIT_BRANCH =~ /^gh-readonly-queue\/.*$/ || $CI_COMMIT_BRANCH =~ /^mq-working-branch-.*$/'

# trigger new commit cancel
workflow:
Expand Down Expand Up @@ -156,6 +157,7 @@ run-tests-trigger:
strategy: depend

serverless lambda tests:
extends: .serverless_rules
stage: tests
trigger:
project: DataDog/datadog-lambda-python
Expand Down Expand Up @@ -696,6 +698,8 @@ prof-correctness:
- job: "upload all"
timeout: 60m
rules:
- if: !reference [.is_gh_merge_queue]
- if: !reference [.is_devflow_merge_queue]
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "main"
# Bare rules:changes is true for web/API/tag pipelines; require a push.
Expand Down Expand Up @@ -758,6 +762,13 @@ lib_injection_tests:
stage: tests
tags: [ "arch:amd64" ]
image: registry.ddbuild.io/dd-trace-py:v106957811-b912d74-lib_injection@sha256:d381042ec0c5d8ba617453feec7ccdffefca8ef0e3011d980728fe1a7a9425eb
rules:
- if: !reference [.run_all_tests]
- changes:
- .gitlab-ci.yml
- lib-injection/**/*
- tests/lib_injection/**/*
- when: never
script: |
echo -e "\e[0Ksection_start:`date +%s`:info[collapsed=true]\r\e[0KPython versions"
pyenv --version
Expand Down Expand Up @@ -807,8 +818,7 @@ profiling_native:
- .profiling_native_base
- .retry_on_all_failure
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "main"
- if: !reference [.run_all_tests]
- changes:
- .gitlab-ci.yml
# Native source files by extension (C, C++, Cython, CMake modules)
Expand Down Expand Up @@ -878,12 +888,159 @@ package-oci:
# 3.15 cell is when: never until the python image is mirrored
optional: true

.system_test_config_changes: &system_test_config_changes
- .gitlab-ci.yml
- .gitlab/system-tests.yml

.onboarding_system_test_changes: &onboarding_system_test_changes
- ddtrace/_monkey.py
- ddtrace/auto.py
- ddtrace/bootstrap/**/*
- ddtrace/commands/ddtrace_run.py
- ddtrace/internal/telemetry/**/*
- lib-injection/**/*
- tests/lib_injection/**/*
- tests/telemetry/**/*

.profiling_system_test_changes: &profiling_system_test_changes
- ddtrace/internal/datadog/profiling/**/*
- ddtrace/internal/settings/profiling.py
- ddtrace/internal/settings/profiling.pyi
- ddtrace/profiling/**/*
- tests/profiling/**/*

.appsec_system_test_changes: &appsec_system_test_changes
- ddtrace/appsec/**/*
- ddtrace/internal/_libddwaf_platform.py
- ddtrace/internal/appsec/**/*
- ddtrace/internal/iast/**/*
- ddtrace/internal/settings/appsec_telemetry.py
- ddtrace/internal/settings/asm.py
- tests/appsec/**/*

.injection_system_test_changes: &injection_system_test_changes
- lib-injection/**/*
- tests/lib_injection/**/*

.system_tests_onboarding_rules:
rules:
- if: '$SKIP_SHARED_PIPELINE == "true" || $DANGEROUSLY_SKIP_SHARED_PIPELINE_TESTS == "true"'
when: never
- if: !reference [.run_all_tests]
- changes: *system_test_config_changes
- changes: *onboarding_system_test_changes
- when: never

.system_tests_profiling_rules:
rules:
- if: '$SKIP_SHARED_PIPELINE == "true" || $DANGEROUSLY_SKIP_SHARED_PIPELINE_TESTS == "true"'
when: never
- if: !reference [.run_all_tests]
- changes: *system_test_config_changes
- changes: *profiling_system_test_changes
- when: never

.system_tests_appsec_rules:
rules:
- if: '$SKIP_SHARED_PIPELINE == "true" || $DANGEROUSLY_SKIP_SHARED_PIPELINE_TESTS == "true"'
when: never
- if: !reference [.run_all_tests]
- changes: *system_test_config_changes
- changes: *appsec_system_test_changes
- when: never

.system_tests_injection_rules:
rules:
- if: '$SKIP_SHARED_PIPELINE == "true" || $DANGEROUSLY_SKIP_SHARED_PIPELINE_TESTS == "true"'
when: never
- if: !reference [.run_all_tests]
- changes: *system_test_config_changes
- changes: *injection_system_test_changes
- when: never

configure_system_tests:
variables:
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection"
rules:
- when: never

system_tests:
needs: ["configure_system_tests", "oci-internal-test-publish", "kubernetes-injection-test-ecr-publish"]
rules:
- when: never

configure_system_tests_onboarding:
extends:
- configure_system_tests
- .system_tests_onboarding_rules
needs: []
variables:
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding"

system_tests_onboarding:
extends:
- system_tests
- .system_tests_onboarding_rules
needs: ["configure_system_tests_onboarding", "oci-internal-test-publish"]
trigger:
include:
- artifact: system_tests_pipeline.yml
job: configure_system_tests_onboarding
strategy: depend

configure_system_tests_profiling:
extends:
- configure_system_tests
- .system_tests_profiling_rules
needs: []
variables:
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding_profiling"

system_tests_profiling:
extends:
- system_tests
- .system_tests_profiling_rules
needs: ["configure_system_tests_profiling", "oci-internal-test-publish"]
trigger:
include:
- artifact: system_tests_pipeline.yml
job: configure_system_tests_profiling
strategy: depend

configure_system_tests_appsec:
extends:
- configure_system_tests
- .system_tests_appsec_rules
needs: []
variables:
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding_appsec"

system_tests_appsec:
extends:
- system_tests
- .system_tests_appsec_rules
needs: ["configure_system_tests_appsec", "oci-internal-test-publish"]
trigger:
include:
- artifact: system_tests_pipeline.yml
job: configure_system_tests_appsec
strategy: depend

configure_system_tests_injection:
extends:
- configure_system_tests
- .system_tests_injection_rules
needs: []
variables:
SYSTEM_TESTS_SCENARIOS_GROUPS: "docker-ssi,lib-injection"

system_tests_injection:
extends:
- system_tests
- .system_tests_injection_rules
needs: ["configure_system_tests_injection", "oci-internal-test-publish", "kubernetes-injection-test-ecr-publish"]
trigger:
include:
- artifact: system_tests_pipeline.yml
job: configure_system_tests_injection
strategy: depend

# The reliability environment installs commit-scoped wheels from the CI index.
deploy_to_reliability_env:
Expand Down
16 changes: 15 additions & 1 deletion .gitlab/benchmarks/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ variables:
SLS_CI_IMAGE: registry.ddbuild.io/ci/serverless-tools:1
SLS_CI_BRANCH: v1.3.0

.serverless_benchmark_changes: &serverless_benchmark_changes
- .gitlab-ci.yml
- .gitlab/benchmarks/serverless.yml
- .gitlab/package.yml
- .gitlab/scripts/build-wheel.sh
- .gitlab/validate-ddtrace-package.py
- setup.py
- pyproject.toml
- ddtrace/internal/serverless/**/*
- ddtrace/contrib/internal/aws_lambda/**/*
- tests/contrib/aws_lambda/**/*

benchmark-serverless:
stage: benchmarks
trigger:
Expand All @@ -13,7 +25,9 @@ benchmark-serverless:
rules:
- if: $RELEASE_ALLOW_BENCHMARK_FAILURES == "true"
allow_failure: true
- allow_failure: false
- if: !reference [.run_all_tests]
- changes: *serverless_benchmark_changes
- when: never
variables:
DD_TAGS: "SLS_CI_BRANCH:$SLS_CI_BRANCH"
UPSTREAM_PIPELINE_ID: $CI_PIPELINE_ID
Expand Down
22 changes: 10 additions & 12 deletions .gitlab/debugging-exploration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@
DD_DEBUGGER_EXPL_STATUS_MESSAGES: 1
PYTEST_PLUGINS: "exploration"
PYTHONPATH: "${CI_PROJECT_DIR}/tests/debugging/exploration/pytest"
rules:
- if: '$RELEASE_ALLOW_TEST_FAILURES == "true" && ($CI_COMMIT_BRANCH =~ /^gh-readonly-queue\/.*$/ || $CI_COMMIT_BRANCH =~ /^mq-working-branch-.*$/)'
allow_failure: true
- if: !reference [.is_gh_merge_queue]
- if: !reference [.is_devflow_merge_queue]
- if: $RELEASE_ALLOW_TEST_FAILURES == "true"
changes: *exploration_changes
allow_failure: true
- changes: *exploration_changes
- when: never
before_script:
- !reference [.testrunner, before_script]
# Install only the wheel matching the running Python version. All 6 per-version
Expand All @@ -66,12 +76,6 @@
extends:
- ".debugging/exploration"
- ".exploration_needs_build_linux_amd64"
rules:
- if: $RELEASE_ALLOW_TEST_FAILURES == "true"
changes: *exploration_changes
allow_failure: true
- changes: *exploration_changes
- when: never
variables:
BOTO3_TAG: "1.38.44"
DD_DEBUGGER_EXPL_INCLUDE: "boto3"
Expand All @@ -88,12 +92,6 @@
extends:
- ".debugging/exploration"
- ".exploration_needs_build_linux_amd64"
rules:
- if: $RELEASE_ALLOW_TEST_FAILURES == "true"
changes: *exploration_changes
allow_failure: true
- changes: *exploration_changes
- when: never
variables:
BOTO3_TAG: "1.38.44"
DD_DEBUGGER_EXPL_INCLUDE: "botocore"
Expand Down
33 changes: 31 additions & 2 deletions .gitlab/multi-os-tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
# Multi-OS Test Suite
# Tests the application across Ubuntu, macOS, and Windows with multiple Python versions
.multi_os_changes: &multi_os_changes
- .gitlab-ci.yml
- .gitlab/multi-os-tests.yml
- .gitlab/package.yml
- .gitlab/requirements/multi-os-tests.txt
- .gitlab/scripts/build-wheel.sh
- .gitlab/scripts/build-wheel-windows.sh
- .gitlab/scripts/multi-os-tests.ps1
- .gitlab/scripts/multi-os-tests.sh
- setup.py
- pyproject.toml
- ddtrace/**/*.c
- ddtrace/**/*.cc
- ddtrace/**/*.cpp
- ddtrace/**/*.h
- ddtrace/**/*.hpp
- ddtrace/**/*.pxd
- ddtrace/**/*.pyx
- ddtrace/appsec/**/*
- ddtrace/internal/_libddwaf_platform.py
- ddtrace/internal/appsec/**/*
- ddtrace/internal/iast/**/*
- ddtrace/internal/settings/appsec_telemetry.py
- ddtrace/internal/settings/asm.py
- src/native/**/*
- src/native_heap_gotter/**/*
- tests/appsec/**/*

.multi_os_test_base:
stage: tests
extends: .retry_on_all_failure
rules:
- if: !reference [.run_all_tests]
- changes: *multi_os_changes
- when: never
variables:
DD_IAST_ENABLED: "false"
DD_REMOTE_CONFIGURATION_ENABLED: "false"
Expand Down
44 changes: 44 additions & 0 deletions .gitlab/native.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,52 @@
include:
- local: ".gitlab/testrunner.yml"

.rust_changes: &rust_changes
- .gitlab-ci.yml
- .gitlab/native.yml
- setup.py
- pyproject.toml
- src/native/**/*
- src/native_heap_gotter/**/*

.profiling_native_changes: &profiling_native_changes
- .gitlab-ci.yml
- .gitlab/native.yml
- setup.py
- pyproject.toml
- ddtrace/internal/datadog/profiling/**/*.cc
- ddtrace/internal/datadog/profiling/**/*.cmake
- ddtrace/internal/datadog/profiling/**/*.cpp
- ddtrace/internal/datadog/profiling/**/*.h
- ddtrace/internal/datadog/profiling/**/*.hpp
- ddtrace/internal/datadog/profiling/**/*.pyx
- ddtrace/internal/datadog/profiling/**/CMakeLists.txt
- ddtrace/internal/datadog/profiling/**/*.sh
- ddtrace/internal/datadog/profiling/**/*.supp
- ddtrace/profiling/**/*.cpp
- ddtrace/profiling/**/*.h
- ddtrace/profiling/**/*.hpp
- ddtrace/profiling/**/*.pxd
- ddtrace/profiling/**/*.pyx
- ddtrace/profiling/**/CMakeLists.txt
- src/native/**/*.rs
- src/native/**/*.toml
- src/native/**/*.txt
- src/native/**/Cargo.lock
- src/native_heap_gotter/**/*.rs
- src/native_heap_gotter/**/*.toml
- src/native_heap_gotter/**/Cargo.lock

"rust ci":
stage: tests
image: !reference [.testrunner, image]
tags: !reference [.testrunner, tags]
timeout: 10m
needs: []
rules:
- if: !reference [.run_all_tests]
- changes: *rust_changes
- when: never
before_script: cd src/native
script:
- |
Expand Down Expand Up @@ -43,6 +83,10 @@ include:
tags: ["arch:amd64"]
timeout: 20m
needs: []
rules:
- if: !reference [.run_all_tests]
- changes: *profiling_native_changes
- when: never
before_script:
- pyenv global 3.12
script:
Expand Down
Loading
Loading