Skip to content

Commit 9cb763a

Browse files
bukkacharmitro
authored andcommitted
Introduce FPM_TEST_DEBUG_FILTER env var and extend multi request tracing
1 parent 8e20a67 commit 9cb763a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

sapi/fpm/tests/tester.inc

+10-5
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,15 @@ class Tester
389389
?bool $debug = null,
390390
string $clientTransport = 'stream'
391391
) {
392-
$this->configTemplate = $configTemplate;
393-
$this->code = $code;
394-
$this->options = $options;
395-
$this->fileName = $fileName ?: self::getCallerFileName();
396-
$this->debug = $debug !== null ? $debug : (bool)getenv('TEST_FPM_DEBUG');
392+
$this->configTemplate = $configTemplate;
393+
$this->code = $code;
394+
$this->options = $options;
395+
$this->fileName = $fileName ?: self::getCallerFileName();
396+
if (($debugFilter = getenv('TEST_FPM_DEBUG_FILTER')) !== false) {
397+
$this->debug = str_contains(basename($this->fileName), $debugFilter);
398+
} else {
399+
$this->debug = $debug !== null ? $debug : (bool)getenv('TEST_FPM_DEBUG');
400+
}
397401
$this->logReader = new LogReader($this->debug);
398402
$this->logTool = new LogTool($this->logReader, $this->debug);
399403
$this->clientTransport = $clientTransport;
@@ -920,6 +924,7 @@ class Tester
920924
$requestData['headers'] ?? [],
921925
$requestData['uri'] ?? null
922926
);
927+
$this->trace('Request params', $params);
923928

924929
if (isset($requestData['delay'])) {
925930
usleep($requestData['delay']);

0 commit comments

Comments
 (0)