-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow to enable all experimental features
- Loading branch information
1 parent
9688e0f
commit 3d127bc
Showing
5 changed files
with
194 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--TEST-- | ||
[profiling] test profiler's extension info with experimental feature override | ||
--DESCRIPTION-- | ||
The profiler's phpinfo section contains important debugging information. This | ||
test verifies that certain information is present. | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('datadog-profiling')) | ||
echo "skip: test requires Datadog Continuous Profiler\n"; | ||
?> | ||
--ENV-- | ||
DD_PROFILING_ENABLED=yes | ||
DD_PROFILING_EXPERIMENTAL_FEATURES_ENABLED=yes | ||
DD_PROFILING_LOG_LEVEL=off | ||
DD_PROFILING_EXPERIMENTAL_CPU_TIME_ENABLED=no | ||
DD_PROFILING_ALLOCATION_ENABLED=no | ||
DD_PROFILING_EXPERIMENTAL_EXCEPTION_ENABLED=no | ||
DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED=no | ||
--INI-- | ||
assert.exception=1 | ||
opcache.jit=off | ||
--FILE-- | ||
<?php | ||
|
||
ob_start(); | ||
$extension = new ReflectionExtension('datadog-profiling'); | ||
$extension->info(); | ||
$output = ob_get_clean(); | ||
|
||
$lines = preg_split("/\R/", $output); | ||
$values = []; | ||
foreach ($lines as $line) { | ||
$pair = explode("=>", $line); | ||
if (count($pair) != 2) { | ||
continue; | ||
} | ||
$values[trim($pair[0])] = trim($pair[1]); | ||
} | ||
|
||
// Check that Version exists, but not its value | ||
assert(isset($values["Version"])); | ||
|
||
// Check exact values for this set | ||
$sections = [ | ||
["Profiling Enabled", "true"], | ||
["Profiling Experimental Features Enabled", "true"], | ||
["Experimental CPU Time Profiling Enabled", "true (all experimental features enabled)"], | ||
["Allocation Profiling Enabled", "false"], | ||
["Experimental Exception Profiling Enabled", "true (all experimental features enabled)"], | ||
["Experimental Timeline Enabled", "true (all experimental features enabled)"], | ||
]; | ||
|
||
foreach ($sections as [$key, $expected]) { | ||
assert( | ||
$values[$key] === $expected, | ||
"Expected '{$expected}', found '{$values[$key]}', for key '{$key}'" | ||
); | ||
} | ||
|
||
echo "Done."; | ||
|
||
?> | ||
--EXPECT-- | ||
Done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--TEST-- | ||
[profiling] test profiler's extension info with experimental feature override | ||
--DESCRIPTION-- | ||
The profiler's phpinfo section contains important debugging information. This | ||
test verifies that certain information is present. | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('datadog-profiling')) | ||
echo "skip: test requires Datadog Continuous Profiler\n"; | ||
?> | ||
--ENV-- | ||
DD_PROFILING_ENABLED=no | ||
DD_PROFILING_EXPERIMENTAL_FEATURES_ENABLED=yes | ||
DD_PROFILING_LOG_LEVEL=off | ||
DD_PROFILING_EXPERIMENTAL_CPU_TIME_ENABLED=no | ||
DD_PROFILING_ALLOCATION_ENABLED=no | ||
DD_PROFILING_EXPERIMENTAL_EXCEPTION_ENABLED=no | ||
DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED=no | ||
--INI-- | ||
assert.exception=1 | ||
opcache.jit=off | ||
--FILE-- | ||
<?php | ||
|
||
ob_start(); | ||
$extension = new ReflectionExtension('datadog-profiling'); | ||
$extension->info(); | ||
$output = ob_get_clean(); | ||
|
||
$lines = preg_split("/\R/", $output); | ||
$values = []; | ||
foreach ($lines as $line) { | ||
$pair = explode("=>", $line); | ||
if (count($pair) != 2) { | ||
continue; | ||
} | ||
$values[trim($pair[0])] = trim($pair[1]); | ||
} | ||
|
||
// Check that Version exists, but not its value | ||
assert(isset($values["Version"])); | ||
|
||
// Check exact values for this set | ||
$sections = [ | ||
["Profiling Enabled", "false"], | ||
["Profiling Experimental Features Enabled", "false (profiling disabled)"], | ||
["Experimental CPU Time Profiling Enabled", "false (profiling disabled)"], | ||
["Allocation Profiling Enabled", "false (profiling disabled)"], | ||
["Experimental Exception Profiling Enabled", "false (profiling disabled)"], | ||
["Experimental Timeline Enabled", "false (profiling disabled)"], | ||
]; | ||
|
||
foreach ($sections as [$key, $expected]) { | ||
assert( | ||
$values[$key] === $expected, | ||
"Expected '{$expected}', found '{$values[$key]}', for key '{$key}'" | ||
); | ||
} | ||
|
||
echo "Done."; | ||
|
||
?> | ||
--EXPECT-- | ||
Done. |