Commit f4c242a
committed
fix(ci): exclude DiscoveryException from PCOV coverage tracking
Root cause: DiscoveryException extends \RuntimeException (a native PHP
class). PCOV cannot properly instrument classes whose constructor chain
leads into native C-extension methods, causing PHPUnit 12 to emit
'not a valid target for code coverage' warnings on every test in
DiscoveryExceptionTest — regardless of failOnWarning sed patches.
Fix: activate coverage_exclude in devkit.php so kcode generates
phpunit.xml.dist with src/Exception excluded from the coverage source.
This eliminates the warning at the PCOV instrumentation level, making
it sed-independent and CI-safe across all environment configurations.
Changes:
- devkit.php: uncomment coverage_exclude => ['src/Exception']
- DiscoveryExceptionTest: remove #[CoversClass(DiscoveryException)]
(invalid target, class excluded from coverage)
- DirectoryScannerTest: remove #[CoversClass(DiscoveryException)] and
its now-unused import (class excluded from coverage)
Verified: kcode quality 4/4, kcode test 222/222 (0 warnings)1 parent ceb2bb0 commit f4c242a
3 files changed
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
0 commit comments