View Issue Details

IDProjectCategoryView StatusLast Update
0001879XdebugInstallationpublic2020-11-10 14:19
Reporterrjung Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionwon't fix 
Product Version3.0.0beta1 
Summary0001879: Bundled unit tests miss to load xdebug in debugged child process
Description

The bundled unit tests use a class tests/debugger/dbgp/dbgpclient.php to run PHP child processes under the debugger. That class starts PHP using proc_open and sets a few xdebug ini parameters for it, but it misses to actually load the xdebug extension.

The Makefile only loads xdebug in the scripts started via run-tests.php, but this doesn't get inherited to the next layer of child processes.

For an environment with dynamically loaded xdebug, the following fix looks appropriate:


--- tests/debugger/dbgp/dbgpclient.php 2020-09-28 12:24:43.000000000 +0000
+++ tests/debugger/dbgp/dbgpclient.php 2020-11-05 12:55:54.631027417 +0000
@@ -58,6 +58,7 @@
);

            $default_options = array(
  • "zend_extension" => "xdebug.so",
    "xdebug.remote_enable" => "1",
    "xdebug.remote_autostart" => "1",
    "xdebug.remote_host" => $this->getIPAddress(),
Steps To Reproduce

Build PHP with xdebug dynamically loadable and then run "make test". Nearly all tests from tests/debugger will FAIL.

Tagstest
Operating SystemAny
PHP Version8.0-dev

Activities

derick

2020-11-05 16:37

administrator   ~0005502

FWIW, "make test" is not something I support or use. It comes from PHP's extension building system, but I need something more so instead use "php run-xdebug-tests.php".

Your "patch" also does not look like something I can merge, as my set-up has "zend_extension=xdebug.so" in php.ini, and loading the extension twice, would make the tests fail.

The README.rst for testing says:


The test framework requires that the PHP binary on the path has Xdebug loaded,
with remote debugging enabled through xdebug.remote_enable=1. It is possible
to skip remote debugging tests by exporting the SKIP_DBGP_TESTS=1 environment
variable.

rjung

2020-11-10 14:17

reporter   ~0005510

Would it be possible, that you give an indication how you run your provided unit tests? You mentioned "php run-xdebug-tests.php"? Should it work just like that, or do you have to set environment variables, give arguments, provide a specific ini file or similar?

rjung

2020-11-10 14:19

reporter   ~0005511

Oups, sorry, just saw you mentioned https://github.com/xdebug/xdebug#testing in another ticket. Will have a look there. Thanks.

Issue History

Date Modified Username Field Change
2020-11-05 16:02 rjung New Issue
2020-11-05 16:02 rjung Tag Attached: test
2020-11-05 16:37 derick Assigned To => derick
2020-11-05 16:37 derick Status new => resolved
2020-11-05 16:37 derick Resolution open => won't fix
2020-11-05 16:37 derick Note Added: 0005502
2020-11-05 16:37 derick Description Updated
2020-11-10 14:17 rjung Note Added: 0005510
2020-11-10 14:19 rjung Note Added: 0005511