Skip to content

Empty PHP settings from the parent process override per-test -d settings forwarded to child processes (breaks PCOV coverage) #6673

@mbeccati

Description

@mbeccati
Q A
PHPUnit version 12.5+
PHP version 8.3+
Installation Method git

Summary

Three tests are failing when pcov is enabled. xdebug builds are passing:

https://github.com/mbeccati/php-latest-builds/actions/runs/26357169506

Current behavior

1) /home/runner/work/php-latest-builds/php-latest-builds/tests/end-to-end/code-coverage/disable-coverage-targeting.phpt
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
   2026-05-24 09:12:59
 
  Summary:
-  Classes: 100.00% (2/2)
-  Methods: 100.00% (2/2)
-  Lines:   100.00% (2/2)
-
-PHPUnit\TestFixture\DisableCoverageTargeting\Bar
-  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
-PHPUnit\TestFixture\DisableCoverageTargeting\Foo
-  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
+  Classes:  0.00% (0/2)
+  Methods:  0.00% (0/2)
+  Lines:    0.00% (0/2)

/home/runner/work/php-latest-builds/php-latest-builds/tests/end-to-end/code-coverage/disable-coverage-targeting.phpt:42
/home/runner/work/php-latest-builds/php-latest-builds/src/Framework/TestSuite.php:381
/home/runner/work/php-latest-builds/php-latest-builds/src/Framework/TestSuite.php:381
/home/runner/work/php-latest-builds/php-latest-builds/src/TextUI/TestRunner.php:64
/home/runner/work/php-latest-builds/php-latest-builds/src/TextUI/Application.php:254

2) /home/runner/work/php-latest-builds/php-latest-builds/tests/end-to-end/code-coverage/include-in-code-coverage.phpt
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
   2026-05-24 09:13:00
 
  Summary:
-  Classes: 100.00% (1/1)
-  Methods: 100.00% (1/1)
-  Lines:   100.00% (1/1)
-
-PHPUnit\TestFixture\Event\IncludeInCodeCoverage\Foo
-  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
+  Classes:  0.00% (0/1)
+  Methods:  0.00% (0/1)
+  Lines:    0.00% (0/1)

/home/runner/work/php-latest-builds/php-latest-builds/tests/end-to-end/code-coverage/include-in-code-coverage.phpt:41
/home/runner/work/php-latest-builds/php-latest-builds/src/Framework/TestSuite.php:381
/home/runner/work/php-latest-builds/php-latest-builds/src/Framework/TestSuite.php:381
/home/runner/work/php-latest-builds/php-latest-builds/src/TextUI/TestRunner.php:64
/home/runner/work/php-latest-builds/php-latest-builds/src/TextUI/Application.php:254

3) /home/runner/work/php-latest-builds/php-latest-builds/tests/end-to-end/regression/5218.phpt
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
   2026-05-24 09:15:02
 
  Summary:
-  Classes: 100.00% (1/1)
-  Methods: 100.00% (1/1)
-  Lines:   100.00% (1/1)
-
-PHPUnit\TestFixture\Issue5218\Issue5218
-  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
+  Classes:  0.00% (0/1)
+  Methods:  0.00% (0/1)
+  Lines:    0.00% (0/1)

/home/runner/work/php-latest-builds/php-latest-builds/tests/end-to-end/regression/5218.phpt:39
/home/runner/work/php-latest-builds/php-latest-builds/src/Framework/TestSuite.php:381
/home/runner/work/php-latest-builds/php-latest-builds/src/Framework/TestSuite.php:381
/home/runner/work/php-latest-builds/php-latest-builds/src/TextUI/TestRunner.php:64
/home/runner/work/php-latest-builds/php-latest-builds/src/TextUI/Application.php:254

How to reproduce

Run test suite using php + pcov

Expected behavior

No failures. I currently have little time and I apologise if I can't help more than this. Failures started with the build from May 21, 12:12 PM GMT+2.

Metadata

Metadata

Labels

feature/phptEnd-to-end tests in PHPT formattype/bugSomething is broken

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions