@@ -23,6 +23,7 @@ function after_script($execute_dir = ".", $has_test_agent = false) {
2323 - .gitlab/check_test_agent.sh
2424<?php endif ; ?>
2525 - .gitlab/collect_artifacts.sh "<?= $ execute_dir ?> "
26+ - .gitlab/upload-junit-to-datadog.sh "test.source.file:src"
2627<?php
2728}
2829
@@ -246,7 +247,9 @@ function before_script_steps() {
246247 MAX_TEST_PARALLELISM: 2
247248 PHP_MAJOR_MINOR: "<?= $ major_minor ?> "
248249 ARCH: "<?= $ arch ?> "
250+ TEST_PHP_JUNIT: "${CI_PROJECT_DIR}/tmp/build_extension/artifacts/tests/php-tests.xml"
249251 script:
252+ - mkdir -p "${CI_PROJECT_DIR}/tmp/build_extension/artifacts/tests"
250253 - make test_c
251254<?php after_script ("tmp/build_extension " , has_test_agent: true ); ?>
252255
@@ -262,7 +265,9 @@ function before_script_steps() {
262265 variables:
263266 PHP_MAJOR_MINOR: "<?= $ major_minor ?> "
264267 ARCH: "<?= $ arch ?> "
268+ TEST_PHP_JUNIT: "${CI_PROJECT_DIR}/artifacts/tests/php-tests.xml"
265269 script:
270+ - mkdir -p "${CI_PROJECT_DIR}/artifacts/tests"
266271 - make test_internal_api_randomized
267272<?php after_script (); ?>
268273
@@ -288,7 +293,9 @@ function before_script_steps() {
288293 variables:
289294 PHP_MAJOR_MINOR: "<?= $ major_minor ?> "
290295 ARCH: "amd64"
296+ TEST_PHP_JUNIT: "${CI_PROJECT_DIR}/artifacts/tests/php-tests.xml"
291297 script:
298+ - mkdir -p "${CI_PROJECT_DIR}/artifacts/tests"
292299 - make test_with_init_hook
293300<?php after_script (); ?>
294301
@@ -310,7 +317,9 @@ function before_script_steps() {
310317 MAX_TEST_PARALLELISM: 4
311318 PHP_MAJOR_MINOR: "<?= $ major_minor ?> "
312319 ARCH: "amd64"
320+ TEST_PHP_JUNIT: "${CI_PROJECT_DIR}/tmp/build_extension/artifacts/tests/php-tests.xml"
313321 script:
322+ - mkdir -p "${CI_PROJECT_DIR}/tmp/build_extension/artifacts/tests"
314323 - make test_c_observer
315324<?php after_script ("tmp/build_extension " , has_test_agent: true ); ?>
316325<?php endif ; ?>
@@ -327,7 +336,9 @@ function before_script_steps() {
327336 variables:
328337 PHP_MAJOR_MINOR: "<?= $ major_minor ?> "
329338 ARCH: "amd64"
339+ TEST_PHP_JUNIT: "${CI_PROJECT_DIR}/artifacts/tests/php-tests.xml"
330340 script:
341+ - mkdir -p "${CI_PROJECT_DIR}/artifacts/tests"
331342 - make test_opcache
332343<?php after_script (); ?>
333344<?php
@@ -378,7 +389,7 @@ function before_script_steps() {
378389 PHP_MAJOR_MINOR: "<?= $ major_minor ?> "
379390 ARCH: "amd64"
380391 script:
381- - make test_unit <?= ASSERT_NO_MEMLEAKS ?>
392+ - make test_unit PHPUNIT_JUNIT="artifacts/tests/php-tests.xml" <?= ASSERT_NO_MEMLEAKS ?>
382393<?php after_script (); ?>
383394
384395"API unit tests: [<?= $ major_minor ?> ]":
@@ -393,7 +404,9 @@ function before_script_steps() {
393404 variables:
394405 PHP_MAJOR_MINOR: "<?= $ major_minor ?> "
395406 ARCH: "amd64"
407+ TEST_PHP_JUNIT: "${CI_PROJECT_DIR}/artifacts/tests/php-tests.xml"
396408 script:
409+ - mkdir -p "${CI_PROJECT_DIR}/artifacts/tests"
397410 - make test_api_unit <?= ASSERT_NO_MEMLEAKS ?>
398411<?php after_script (); ?>
399412
@@ -409,6 +422,7 @@ function before_script_steps() {
409422 variables:
410423 PHP_MAJOR_MINOR: "<?= $ major_minor ?> "
411424 ARCH: "amd64"
425+ TEST_PHP_JUNIT: "${CI_PROJECT_DIR}/artifacts/tests/php-tests.xml"
412426<?php if (version_compare ($ major_minor , "7.4 " , ">= " )): ?>
413427 KUBERNETES_CPU_REQUEST: 8
414428 MAX_TEST_PARALLELISM: 16
@@ -417,6 +431,7 @@ function before_script_steps() {
417431 timeout: 40m
418432<?php endif ; ?>
419433 script:
434+ - mkdir -p "${CI_PROJECT_DIR}/artifacts/tests"
420435 - make test_c_disabled <?= ASSERT_NO_MEMLEAKS ?>
421436<?php after_script (); ?>
422437
@@ -432,7 +447,9 @@ function before_script_steps() {
432447 variables:
433448 PHP_MAJOR_MINOR: "<?= $ major_minor ?> "
434449 ARCH: "amd64"
450+ TEST_PHP_JUNIT: "${CI_PROJECT_DIR}/artifacts/tests/php-tests.xml"
435451 script:
452+ - mkdir -p "${CI_PROJECT_DIR}/artifacts/tests"
436453 - make test_internal_api_randomized
437454<?php after_script (); ?>
438455
@@ -448,7 +465,9 @@ function before_script_steps() {
448465 variables:
449466 PHP_MAJOR_MINOR: "<?= $ major_minor ?> "
450467 ARCH: "amd64"
468+ TEST_PHP_JUNIT: "${CI_PROJECT_DIR}/tmp/build_extension/artifacts/tests/php-tests.xml"
451469 script:
470+ - mkdir -p "${CI_PROJECT_DIR}/tmp/build_extension/artifacts/tests"
452471 - make test_opcache
453472<?php after_script ("tmp/build_extension " ); ?>
454473
@@ -471,7 +490,7 @@ function before_script_steps() {
471490 DD_TRACE_WARN_LEGACY_DD_TRACE: "0"
472491 DD_TRACE_GIT_METADATA_ENABLED: "0"
473492 REPORT_EXIT_STATUS: "1"
474- TEST_PHP_JUNIT: "/tmp /artifacts/tests/php-tests.xml"
493+ TEST_PHP_JUNIT: "${CI_PROJECT_DIR} /artifacts/tests/php-tests.xml"
475494 SKIP_ONLINE_TEST: "1"
476495<?php if (version_compare ($ major_minor , "7.2 " , ">= " )): /* too expensive */ ?>
477496 DD_INSTRUMENTATION_TELEMETRY_ENABLED: 0
@@ -504,7 +523,7 @@ function before_script_steps() {
504523 - make composer_tests_update
505524 - .gitlab/wait-for-service-ready.sh
506525 script:
507- - DD_TRACE_AGENT_TIMEOUT=1000 make $MAKE_TARGET RUST_DEBUG_BUILD=1 PHPUNIT_OPTS="--log-junit artifacts/tests/results.xml" <?= ASSERT_NO_MEMLEAKS ?>
526+ - DD_TRACE_AGENT_TIMEOUT=1000 make $MAKE_TARGET RUST_DEBUG_BUILD=1 PHPUNIT_JUNIT=" artifacts/tests/results.xml" <?= ASSERT_NO_MEMLEAKS ?>
508527<?php after_script (". " , true ); ?>
509528 - find tests -type f \( -name 'phpunit_error.log' -o -name 'nginx_*.log' -o -name 'apache_*.log' -o -name 'php_fpm_*.log' -o -name 'dd_php_error.log' \) -exec cp --parents '{}' artifacts \;
510529 - make tested_versions && cp tests/tested_versions/tested_versions.json artifacts/tested_versions_${MAKE_TARGET}_${PHP_MAJOR_MINOR}_${DD_TRACE_TEST_SAPI:-cli}.json
@@ -685,7 +704,7 @@ function before_script_steps() {
685704 - php /usr/local/src/php/run-tests.php -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP -p $(which php) --show-all -d zend_extension=xdebug-<?= $ xdebug ?> .so "tests/xdebug/<?= $ xdebug [0 ] == 2 ? $ xdebug : "3.0.0 " ?> "
686705<?php if ($ xdebug != "2.7.2 " && $ xdebug != "2.9.2 " ): ?>
687706 - '# Run unit tests with xdebug'
688- - TEST_EXTRA_INI='-d zend_extension=xdebug-<?= $ xdebug ?> .so' make test_unit RUST_DEBUG_BUILD=1 PHPUNIT_OPTS="--log-junit test-results/php-unit/results_unit.xml"
707+ - TEST_EXTRA_INI='-d zend_extension=xdebug-<?= $ xdebug ?> .so' make test_unit RUST_DEBUG_BUILD=1 PHPUNIT_JUNIT=" test-results/php-unit/results_unit.xml"
689708<?php endif ; ?>
690709<?php after_script (has_test_agent: true ); ?>
691710
0 commit comments