Skip to content

Commit e623d7e

Browse files
add test to ensure the profiler does not emit profiles when inactive
1 parent 3b04614 commit e623d7e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/prof_correctness.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,30 @@ jobs:
5555
target/
5656
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
5757

58+
- name: Run no profile test
59+
run: |
60+
export DD_PROFILING_ENABLED=Off
61+
export DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED=1
62+
export DD_PROFILING_EXPERIMENTAL_EXCEPTION_ENABLED=1
63+
export DD_PROFILING_EXPERIMENTAL_EXCEPTION_SAMPLING_DISTANCE=1
64+
php -d extension=target/release/libdatadog_php_profiling.so --ri datadog-profiling
65+
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions"; do
66+
mkdir -p profiling/tests/correctness/"$test_case"/
67+
export DD_PROFILING_OUTPUT_PPROF=$PWD/profiling/tests/correctness/"$test_case"/test.pprof
68+
php -d extension=$PWD/target/release/libdatadog_php_profiling.so profiling/tests/correctness/"$test_case".php
69+
if [ -f "$DD_PROFILING_OUTPUT_PPROF".1.lz4 ]; then
70+
echo "File $DD_PROFILING_OUTPUT_PPROF.1.lz4 should not exist!"
71+
exit 1;
72+
fi
73+
done
74+
5875
- name: Run tests
5976
run: |
6077
export DD_PROFILING_LOG_LEVEL=trace
6178
export DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED=1
6279
export DD_PROFILING_EXPERIMENTAL_EXCEPTION_ENABLED=1
6380
export DD_PROFILING_EXPERIMENTAL_EXCEPTION_SAMPLING_DISTANCE=1
64-
php -d extension=target/release/libdatadog_php_profiling.so -v
81+
php -d extension=target/release/libdatadog_php_profiling.so --ri datadog-profiling
6582
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions"; do
6683
mkdir -p profiling/tests/correctness/"$test_case"/
6784
export DD_PROFILING_OUTPUT_PPROF=$PWD/profiling/tests/correctness/"$test_case"/test.pprof

0 commit comments

Comments
 (0)