Skip to content

Commit 40554c4

Browse files
run language tests for profiler
1 parent f30b862 commit 40554c4

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.gitlab/generate-profiler.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
script:
3737
- if [ -d '/opt/rh/devtoolset-7' ]; then set +eo pipefail; source scl_source enable devtoolset-7; set -eo pipefail; fi
3838
- if [ -f /sbin/apk ] && [ $(uname -m) = "aarch64" ]; then ln -sf ../lib/llvm17/bin/clang /usr/bin/clang; fi
39+
- export DD_PROFILING_OUTPUT_PPROF=/tmp/
3940

4041
- cd profiling
4142
- export TEST_PHP_EXECUTABLE=$(which php)
@@ -74,3 +75,27 @@
7475
- sed -i -e "s/crate-type.*$/crate-type = [\"rlib\"]/g" Cargo.toml
7576
- cargo clippy --all-targets --all-features -- -D warnings -Aunknown-lints
7677

78+
"PHP language tests":
79+
stage: test
80+
tags: [ "arch:${ARCH}" ]
81+
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_buster
82+
variables:
83+
KUBERNETES_CPU_REQUEST: 5
84+
KUBERNETES_MEMORY_REQUEST: 3Gi
85+
KUBERNETES_MEMORY_LIMIT: 4Gi
86+
CARGO_TARGET_DIR: /mnt/ramdisk/cargo # ramdisk??
87+
libdir: /tmp/datadog-profiling
88+
parallel:
89+
matrix:
90+
- PHP_MAJOR_MINOR: *all_profiler_targets
91+
ARCH: *arch_targets
92+
FLAVOUR: [nts, zts]
93+
script:
94+
- cd profiling
95+
- unset DD_SERVICE; unset DD_ENV
96+
- export DD_PROFILING_OUTPUT_PPROF=/tmp/
97+
98+
- if [ "${FLAVOUR}" = "zts" ]; then SUFFIX="-zts"; else SUFFIX=""; fi
99+
- command -v switch-php && switch-php "${PHP_MAJOR_MINOR}${SUFFIX}"
100+
- cargo build --release --all-features
101+
- .gitlab/run_php_language_tests_profiling.sh /mnt/ramdisk/cargo/release/libdatadog_php_profiling.so
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -eo pipefail
3+
4+
# Helper to parse version strings for comparison
5+
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
6+
7+
cd /usr/local/src/php
8+
9+
# -j flag is only available in PHP 7.4+
10+
extra_args=""
11+
if [[ -n "${PHP_MAJOR_MINOR}" && $(version $PHP_MAJOR_MINOR) -ge $(version 7.4) ]]; then
12+
extra_args="-j$(nproc)"
13+
fi
14+
15+
php run-tests.php -q \
16+
-p /usr/local/bin/php \
17+
--show-diff \
18+
-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
19+
-d extension=$1
20+
$extra_args

0 commit comments

Comments
 (0)