Skip to content

Commit

Permalink
add test to ensure the profiler does not emit profiles when inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl committed Nov 28, 2023
1 parent 3b04614 commit e623d7e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/prof_correctness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,30 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run no profile test
run: |
export DD_PROFILING_ENABLED=Off
export DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED=1
export DD_PROFILING_EXPERIMENTAL_EXCEPTION_ENABLED=1
export DD_PROFILING_EXPERIMENTAL_EXCEPTION_SAMPLING_DISTANCE=1
php -d extension=target/release/libdatadog_php_profiling.so --ri datadog-profiling
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions"; do
mkdir -p profiling/tests/correctness/"$test_case"/
export DD_PROFILING_OUTPUT_PPROF=$PWD/profiling/tests/correctness/"$test_case"/test.pprof
php -d extension=$PWD/target/release/libdatadog_php_profiling.so profiling/tests/correctness/"$test_case".php
if [ -f "$DD_PROFILING_OUTPUT_PPROF".1.lz4 ]; then
echo "File $DD_PROFILING_OUTPUT_PPROF.1.lz4 should not exist!"
exit 1;
fi
done
- name: Run tests
run: |
export DD_PROFILING_LOG_LEVEL=trace
export DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED=1
export DD_PROFILING_EXPERIMENTAL_EXCEPTION_ENABLED=1
export DD_PROFILING_EXPERIMENTAL_EXCEPTION_SAMPLING_DISTANCE=1
php -d extension=target/release/libdatadog_php_profiling.so -v
php -d extension=target/release/libdatadog_php_profiling.so --ri datadog-profiling
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions"; do
mkdir -p profiling/tests/correctness/"$test_case"/
export DD_PROFILING_OUTPUT_PPROF=$PWD/profiling/tests/correctness/"$test_case"/test.pprof
Expand Down

0 comments on commit e623d7e

Please sign in to comment.