From 79fc2ddc4d91ed2371402eb23105982fb14d8857 Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Tue, 12 Aug 2025 10:47:48 +0200 Subject: [PATCH 1/5] test: add debug logs Signed-off-by: Alexandre Rulleau --- docker-compose.linux.override.yml | 20 +++++++++---------- dockerfiles/ci/xfail_tests/8.0.list | 1 + tests/ext/library_config/fleet_config.phpt | 23 ++++++++++++++++++++++ tests/ext/library_config/local_config.phpt | 22 +++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-) diff --git a/docker-compose.linux.override.yml b/docker-compose.linux.override.yml index d812a417d2d..caa58d41348 100644 --- a/docker-compose.linux.override.yml +++ b/docker-compose.linux.override.yml @@ -16,13 +16,13 @@ services: # --- Alpine --- '8.0-alpine': { <<: *linux_php_service } # --- Buster --- - '7.0-buster': { <<: *linux_php_service } - '7.1-buster': { <<: *linux_php_service } - '7.2-buster': { <<: *linux_php_service } - '7.3-buster': { <<: *linux_php_service } - '7.4-buster': { <<: *linux_php_service } - '8.0-buster': { <<: *linux_php_service } - '8.1-buster': { <<: *linux_php_service } - '8.2-buster': { <<: *linux_php_service } - '8.3-buster': { <<: *linux_php_service } - '8.4-buster': { <<: *linux_php_service } + '7.0-bookworm': { <<: *linux_php_service } + '7.1-bookworm': { <<: *linux_php_service } + '7.2-bookworm': { <<: *linux_php_service } + '7.3-bookworm': { <<: *linux_php_service } + '7.4-bookworm': { <<: *linux_php_service } + '8.0-bookworm': { <<: *linux_php_service } + '8.1-bookworm': { <<: *linux_php_service } + '8.2-bookworm': { <<: *linux_php_service } + '8.3-bookworm': { <<: *linux_php_service } + '8.4-bookworm': { <<: *linux_php_service } diff --git a/dockerfiles/ci/xfail_tests/8.0.list b/dockerfiles/ci/xfail_tests/8.0.list index 24384221fc8..495eb536c6e 100644 --- a/dockerfiles/ci/xfail_tests/8.0.list +++ b/dockerfiles/ci/xfail_tests/8.0.list @@ -562,3 +562,4 @@ ext/standard/tests/http/ghsa-hgf5-96fm-v528-003.phpt ext/standard/tests/http/ghsa-hgf5-96fm-v528-002.phpt ext/standard/tests/http/ghsa-hgf5-96fm-v528-001.phpt ext/standard/tests/http/ignore_errors.phpt +ext/standard/tests/general_functions/proc_open02.phpt diff --git a/tests/ext/library_config/fleet_config.phpt b/tests/ext/library_config/fleet_config.phpt index fa92ae20739..702eabdaf17 100644 --- a/tests/ext/library_config/fleet_config.phpt +++ b/tests/ext/library_config/fleet_config.phpt @@ -18,6 +18,8 @@ copy(__DIR__.'/fleet_config.yaml', '/tmp/test_c_fleet_config.yaml'); _DD_TEST_LIBRARY_CONFIG_FLEET_FILE=/tmp/test_c_fleet_config.yaml _DD_TEST_LIBRARY_CONFIG_LOCAL_FILE=/foo DD_TRACE_SPANS_LIMIT=42 +DD_TRACE_DEBUG=1 +DD_TRACE_LOG_FILE=/tmp/log-fleet-config.txt --INI-- datadog.trace.agent_url="file://{PWD}/fleet-config-telemetry.out" --FILE-- @@ -68,6 +70,27 @@ for ($i = 0; $i < 100; ++$i) { } } + +if (!file_exists(__DIR__ . '/fleet-config-telemetry.out')) { + echo "Telemetry file not found\n"; + + $logFile = '/tmp/log-fleet-config.txt'; + if (file_exists($logFile)) { + echo "Dumping log preview:\n"; + $handle = fopen($logFile, 'r'); + if ($handle) { + $lineCount = 0; + while (!feof($handle) && $lineCount < 10000) { + echo fgets($handle); + $lineCount++; + } + fclose($handle); + } + } else { + echo "Log file does not exist\n"; + } +} + ?> --EXPECT-- DD_SERVICE: service_from_fleet_config diff --git a/tests/ext/library_config/local_config.phpt b/tests/ext/library_config/local_config.phpt index fdcae9887a2..16d4f6d4170 100644 --- a/tests/ext/library_config/local_config.phpt +++ b/tests/ext/library_config/local_config.phpt @@ -18,6 +18,8 @@ copy(__DIR__.'/local_config.yaml', '/tmp/test_c_local_config.yaml'); _DD_TEST_LIBRARY_CONFIG_FLEET_FILE=/foo _DD_TEST_LIBRARY_CONFIG_LOCAL_FILE=/tmp/test_c_local_config.yaml DD_TRACE_SPANS_LIMIT=42 +DD_TRACE_DEBUG=1 +DD_TRACE_LOG_FILE=/tmp/log-local-config.txt --INI-- datadog.trace.agent_url="file://{PWD}/local-config-telemetry.out" --FILE-- @@ -68,6 +70,26 @@ for ($i = 0; $i < 100; ++$i) { } } +if (!file_exists(__DIR__ . '/local-config-telemetry.out')) { + echo "Telemetry file not found\n"; + + $logFile = '/tmp/log-local-config.txt'; + if (file_exists($logFile)) { + echo "Dumping log preview:\n"; + $handle = fopen($logFile, 'r'); + if ($handle) { + $lineCount = 0; + while (!feof($handle) && $lineCount < 10000) { + echo fgets($handle); + $lineCount++; + } + fclose($handle); + } + } else { + echo "Log file does not exist\n"; + } +} + ?> --EXPECT-- DD_SERVICE: service_from_local_config From 2c72de4134d638b5012c3911f25361e321b0f7be Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Mon, 25 Aug 2025 15:19:25 +0200 Subject: [PATCH 2/5] test: debug sqlsrv integration Signed-off-by: Alexandre Rulleau --- .gitlab/generate-tracer.php | 2 +- tests/ext/library_config/fleet_config.phpt | 23 ------------------- .../fleet_config_overloads_env.phpt | 2 ++ tests/ext/library_config/local_config.phpt | 22 ------------------ .../local_config_does_not_overload_env.phpt | 2 ++ 5 files changed, 5 insertions(+), 46 deletions(-) diff --git a/.gitlab/generate-tracer.php b/.gitlab/generate-tracer.php index 49f82cb73af..bbfc53fb57a 100644 --- a/.gitlab/generate-tracer.php +++ b/.gitlab/generate-tracer.php @@ -180,7 +180,7 @@ function before_script_steps() { stage: test tags: [ "arch:${ARCH}" ] image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-5 - timeout: 30m + timeout: 60m variables: host_os: linux-gnu COMPOSER_MEMORY_LIMIT: "-1" diff --git a/tests/ext/library_config/fleet_config.phpt b/tests/ext/library_config/fleet_config.phpt index 702eabdaf17..fa92ae20739 100644 --- a/tests/ext/library_config/fleet_config.phpt +++ b/tests/ext/library_config/fleet_config.phpt @@ -18,8 +18,6 @@ copy(__DIR__.'/fleet_config.yaml', '/tmp/test_c_fleet_config.yaml'); _DD_TEST_LIBRARY_CONFIG_FLEET_FILE=/tmp/test_c_fleet_config.yaml _DD_TEST_LIBRARY_CONFIG_LOCAL_FILE=/foo DD_TRACE_SPANS_LIMIT=42 -DD_TRACE_DEBUG=1 -DD_TRACE_LOG_FILE=/tmp/log-fleet-config.txt --INI-- datadog.trace.agent_url="file://{PWD}/fleet-config-telemetry.out" --FILE-- @@ -70,27 +68,6 @@ for ($i = 0; $i < 100; ++$i) { } } - -if (!file_exists(__DIR__ . '/fleet-config-telemetry.out')) { - echo "Telemetry file not found\n"; - - $logFile = '/tmp/log-fleet-config.txt'; - if (file_exists($logFile)) { - echo "Dumping log preview:\n"; - $handle = fopen($logFile, 'r'); - if ($handle) { - $lineCount = 0; - while (!feof($handle) && $lineCount < 10000) { - echo fgets($handle); - $lineCount++; - } - fclose($handle); - } - } else { - echo "Log file does not exist\n"; - } -} - ?> --EXPECT-- DD_SERVICE: service_from_fleet_config diff --git a/tests/ext/library_config/fleet_config_overloads_env.phpt b/tests/ext/library_config/fleet_config_overloads_env.phpt index 7c308692120..68f39baf884 100644 --- a/tests/ext/library_config/fleet_config_overloads_env.phpt +++ b/tests/ext/library_config/fleet_config_overloads_env.phpt @@ -23,6 +23,8 @@ echo 'DD_ENV: '.dd_trace_env_config("DD_ENV")."\n"; // System INI echo 'DD_DYNAMIC_INSTRUMENTATION_ENABLED: '.to_str(dd_trace_env_config("DD_DYNAMIC_INSTRUMENTATION_ENABLED"))."\n"; +dd_trace_internal_fn("finalize_telemetry"); + ?> --EXPECT-- DD_SERVICE: service_from_fleet_config diff --git a/tests/ext/library_config/local_config.phpt b/tests/ext/library_config/local_config.phpt index 16d4f6d4170..fdcae9887a2 100644 --- a/tests/ext/library_config/local_config.phpt +++ b/tests/ext/library_config/local_config.phpt @@ -18,8 +18,6 @@ copy(__DIR__.'/local_config.yaml', '/tmp/test_c_local_config.yaml'); _DD_TEST_LIBRARY_CONFIG_FLEET_FILE=/foo _DD_TEST_LIBRARY_CONFIG_LOCAL_FILE=/tmp/test_c_local_config.yaml DD_TRACE_SPANS_LIMIT=42 -DD_TRACE_DEBUG=1 -DD_TRACE_LOG_FILE=/tmp/log-local-config.txt --INI-- datadog.trace.agent_url="file://{PWD}/local-config-telemetry.out" --FILE-- @@ -70,26 +68,6 @@ for ($i = 0; $i < 100; ++$i) { } } -if (!file_exists(__DIR__ . '/local-config-telemetry.out')) { - echo "Telemetry file not found\n"; - - $logFile = '/tmp/log-local-config.txt'; - if (file_exists($logFile)) { - echo "Dumping log preview:\n"; - $handle = fopen($logFile, 'r'); - if ($handle) { - $lineCount = 0; - while (!feof($handle) && $lineCount < 10000) { - echo fgets($handle); - $lineCount++; - } - fclose($handle); - } - } else { - echo "Log file does not exist\n"; - } -} - ?> --EXPECT-- DD_SERVICE: service_from_local_config diff --git a/tests/ext/library_config/local_config_does_not_overload_env.phpt b/tests/ext/library_config/local_config_does_not_overload_env.phpt index 302f21e2d80..d717448ab3e 100644 --- a/tests/ext/library_config/local_config_does_not_overload_env.phpt +++ b/tests/ext/library_config/local_config_does_not_overload_env.phpt @@ -23,6 +23,8 @@ echo 'DD_ENV: '.dd_trace_env_config("DD_ENV")."\n"; // System INI echo 'DD_DYNAMIC_INSTRUMENTATION_ENABLED: '.to_str(dd_trace_env_config("DD_DYNAMIC_INSTRUMENTATION_ENABLED"))."\n"; +dd_trace_internal_fn("finalize_telemetry"); + ?> --EXPECT-- DD_SERVICE: service_from_env From 8f2caeb954202ee9562751d60eba08c2b9b4bec2 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Mon, 1 Sep 2025 16:03:50 +0200 Subject: [PATCH 3/5] Update composer to version 2 Composer version 1 has been turned off, so we no longer have to care. Signed-off-by: Bob Weinand --- dockerfiles/ci/alpine/php-8.0/Dockerfile | 2 +- dockerfiles/ci/bookworm/php-8.0/Dockerfile | 2 +- dockerfiles/ci/bookworm/php-8.1/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dockerfiles/ci/alpine/php-8.0/Dockerfile b/dockerfiles/ci/alpine/php-8.0/Dockerfile index b5fc9ab3cb9..4ecb3c521d7 100644 --- a/dockerfiles/ci/alpine/php-8.0/Dockerfile +++ b/dockerfiles/ci/alpine/php-8.0/Dockerfile @@ -90,7 +90,7 @@ RUN set -eux; \ switch-php ${PHP_VERSION}-debug; # Install Composer -COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer +COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer COPY welcome /etc/motd diff --git a/dockerfiles/ci/bookworm/php-8.0/Dockerfile b/dockerfiles/ci/bookworm/php-8.0/Dockerfile index 9287c50dc24..6ff8fc523a7 100644 --- a/dockerfiles/ci/bookworm/php-8.0/Dockerfile +++ b/dockerfiles/ci/bookworm/php-8.0/Dockerfile @@ -85,7 +85,7 @@ RUN set -eux; \ switch-php debug; # Install Composer -COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer +COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer COPY welcome /etc/motd RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd diff --git a/dockerfiles/ci/bookworm/php-8.1/Dockerfile b/dockerfiles/ci/bookworm/php-8.1/Dockerfile index a59204b2395..15d7a69d71f 100644 --- a/dockerfiles/ci/bookworm/php-8.1/Dockerfile +++ b/dockerfiles/ci/bookworm/php-8.1/Dockerfile @@ -86,7 +86,7 @@ RUN set -eux; \ switch-php debug; # Install Composer -COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer +COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer COPY welcome /etc/motd RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd From 7696dc20c7d31f5398015373440bc22d349ded05 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Mon, 1 Sep 2025 16:07:38 +0200 Subject: [PATCH 4/5] Exclude ext/posix/tests/posix_getgrnam_basic.phpt Signed-off-by: Bob Weinand --- dockerfiles/ci/xfail_tests/7.4.list | 1 + dockerfiles/ci/xfail_tests/8.0.list | 1 + dockerfiles/ci/xfail_tests/8.1.list | 1 + dockerfiles/ci/xfail_tests/8.2.list | 1 + dockerfiles/ci/xfail_tests/8.3.list | 1 + dockerfiles/ci/xfail_tests/8.4.list | 1 + 6 files changed, 6 insertions(+) diff --git a/dockerfiles/ci/xfail_tests/7.4.list b/dockerfiles/ci/xfail_tests/7.4.list index 442518a8b3c..89b8bc09215 100644 --- a/dockerfiles/ci/xfail_tests/7.4.list +++ b/dockerfiles/ci/xfail_tests/7.4.list @@ -264,6 +264,7 @@ ext/phar/tests/phar_buildfromiterator8.phpt ext/phar/tests/phar_oo_002.phpt ext/phar/tests/phar_oo_005.phpt ext/phar/tests/phar_oo_007.phpt +ext/posix/tests/posix_getgrnam_basic.phpt ext/readline/tests/libedit_callback_handler_install_001.phpt ext/readline/tests/libedit_callback_handler_remove_001.phpt ext/reflection/tests/009.phpt diff --git a/dockerfiles/ci/xfail_tests/8.0.list b/dockerfiles/ci/xfail_tests/8.0.list index 495eb536c6e..ae4be2c87b3 100644 --- a/dockerfiles/ci/xfail_tests/8.0.list +++ b/dockerfiles/ci/xfail_tests/8.0.list @@ -311,6 +311,7 @@ ext/phar/tests/phar_metadata_write4.phpt ext/phar/tests/phar_oo_002.phpt ext/phar/tests/phar_oo_005.phpt ext/phar/tests/phar_oo_007.phpt +ext/posix/tests/posix_getgrnam_basic.phpt ext/readline/tests/libedit_callback_handler_install_001.phpt ext/readline/tests/libedit_callback_handler_remove_001.phpt ext/reflection/tests/009.phpt diff --git a/dockerfiles/ci/xfail_tests/8.1.list b/dockerfiles/ci/xfail_tests/8.1.list index d33e11193d2..d2da51146bd 100644 --- a/dockerfiles/ci/xfail_tests/8.1.list +++ b/dockerfiles/ci/xfail_tests/8.1.list @@ -128,6 +128,7 @@ ext/phar/tests/phar_metadata_write4.phpt ext/phar/tests/phar_oo_002.phpt ext/phar/tests/phar_oo_005.phpt ext/phar/tests/phar_oo_007.phpt +ext/posix/tests/posix_getgrnam_basic.phpt ext/readline/tests/libedit_callback_handler_install_001.phpt ext/readline/tests/libedit_callback_handler_remove_001.phpt ext/simplexml/tests/bug51615.phpt diff --git a/dockerfiles/ci/xfail_tests/8.2.list b/dockerfiles/ci/xfail_tests/8.2.list index 5384e33dc55..361a6c24cbe 100644 --- a/dockerfiles/ci/xfail_tests/8.2.list +++ b/dockerfiles/ci/xfail_tests/8.2.list @@ -118,6 +118,7 @@ ext/phar/tests/phar_metadata_write4.phpt ext/phar/tests/phar_oo_002.phpt ext/phar/tests/phar_oo_005.phpt ext/phar/tests/phar_oo_007.phpt +ext/posix/tests/posix_getgrnam_basic.phpt ext/readline/tests/libedit_callback_handler_install_001.phpt ext/readline/tests/libedit_callback_handler_remove_001.phpt ext/simplexml/tests/bug51615.phpt diff --git a/dockerfiles/ci/xfail_tests/8.3.list b/dockerfiles/ci/xfail_tests/8.3.list index 6a3f5ae23e3..805bd7cc1f2 100644 --- a/dockerfiles/ci/xfail_tests/8.3.list +++ b/dockerfiles/ci/xfail_tests/8.3.list @@ -116,6 +116,7 @@ ext/phar/tests/phar_metadata_write4.phpt ext/phar/tests/phar_oo_002.phpt ext/phar/tests/phar_oo_005.phpt ext/phar/tests/phar_oo_007.phpt +ext/posix/tests/posix_getgrnam_basic.phpt ext/readline/tests/libedit_callback_handler_install_001.phpt ext/readline/tests/libedit_callback_handler_remove_001.phpt ext/simplexml/tests/bug51615.phpt diff --git a/dockerfiles/ci/xfail_tests/8.4.list b/dockerfiles/ci/xfail_tests/8.4.list index 4f3c4b68b25..092bee43d09 100644 --- a/dockerfiles/ci/xfail_tests/8.4.list +++ b/dockerfiles/ci/xfail_tests/8.4.list @@ -120,6 +120,7 @@ ext/phar/tests/phar_metadata_write4.phpt ext/phar/tests/phar_oo_002.phpt ext/phar/tests/phar_oo_005.phpt ext/phar/tests/phar_oo_007.phpt +ext/posix/tests/posix_getgrnam_basic.phpt ext/readline/tests/libedit_callback_handler_install_001.phpt ext/readline/tests/libedit_callback_handler_remove_001.phpt ext/simplexml/tests/bug51615.phpt From b9078c6c919ec560ec65ba2e84c91d1be40ec1d5 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Mon, 1 Sep 2025 16:17:13 +0200 Subject: [PATCH 5/5] Fix flow testsuite Signed-off-by: Bob Weinand --- docker-compose.linux.override.yml | 2 +- dockerfiles/ci/buster/php-8.0/Dockerfile | 2 +- dockerfiles/ci/buster/php-8.1/Dockerfile | 2 +- dockerfiles/frameworks/flow.yml | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docker-compose.linux.override.yml b/docker-compose.linux.override.yml index caa58d41348..e51c70cc016 100644 --- a/docker-compose.linux.override.yml +++ b/docker-compose.linux.override.yml @@ -15,7 +15,7 @@ x-aliases: services: # --- Alpine --- '8.0-alpine': { <<: *linux_php_service } - # --- Buster --- + # --- Bookworm --- '7.0-bookworm': { <<: *linux_php_service } '7.1-bookworm': { <<: *linux_php_service } '7.2-bookworm': { <<: *linux_php_service } diff --git a/dockerfiles/ci/buster/php-8.0/Dockerfile b/dockerfiles/ci/buster/php-8.0/Dockerfile index 8160220cf83..38c6571c675 100644 --- a/dockerfiles/ci/buster/php-8.0/Dockerfile +++ b/dockerfiles/ci/buster/php-8.0/Dockerfile @@ -84,7 +84,7 @@ RUN set -eux; \ switch-php debug; # Install Composer -COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer +COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer COPY welcome /etc/motd RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd diff --git a/dockerfiles/ci/buster/php-8.1/Dockerfile b/dockerfiles/ci/buster/php-8.1/Dockerfile index 918a2c4c0cd..57ecd31b087 100644 --- a/dockerfiles/ci/buster/php-8.1/Dockerfile +++ b/dockerfiles/ci/buster/php-8.1/Dockerfile @@ -85,7 +85,7 @@ RUN set -eux; \ switch-php debug; # Install Composer -COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer +COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer COPY welcome /etc/motd RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd diff --git a/dockerfiles/frameworks/flow.yml b/dockerfiles/frameworks/flow.yml index 807f0057cdf..9eed48b33da 100644 --- a/dockerfiles/frameworks/flow.yml +++ b/dockerfiles/frameworks/flow.yml @@ -4,6 +4,8 @@ services: flow: depends_on: ['mysql', 'nginx_file_server'] image: 'datadog/dd-trace-ci:php-framework-flow' + environment: + DD_LOGS_INJECTION: "false" build: context: contrib target: flow @@ -17,7 +19,6 @@ services: MYSQL_ROOT_PASSWORD: "" MYSQL_ALLOW_EMPTY_PASSWORD: 1 MYSQL_ROOT_HOST: "%" - DD_LOGS_INJECTION: "false" expose: ["3306"] healthcheck: test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]