test: Infection MSI 100%#78
Open
Zorin-Alexey wants to merge 62 commits into
Open
Conversation
CallableInvoker: reflectCallableValue, валидация array-callable, тесты throw-путей; ClassScanner: AAAA-noise для Continue_; minMsi/minCoveredMsi 100%, timeout 90s.
50f8499 to
8d97a0d
Compare
Детерминированный обход ClassScanner; pcov.directory в initial tests; тесты scan/property/pool/alias; счётчик visited в ServiceAliasResolver.
Сортировка всех файлов в ClassScanner; fixture ScanOrder; тесты в основных *Test для merger, loader, applicator и scanner.
PHPUnit пишет junit+coverage-xml; Infection пропускает initial run и берёт полную карту покрытия pcov — те же тесты, что на CI.
pcov на CI не связывал все covering-тесты со строками; xdebug даёт полную карту для coverage-xml и MSI 100%.
Убран skip-initial-tests; xdebug.mode=coverage для initial run; перед mutation на CI сбрасываются кэши PHPUnit/Infection.
Тест порядка ClassScanner (usort), throw-путь CallableInvoker, кэш lazy CallableInvoker; opcache off для initial run Infection.
Infection на CI не запускал covering-тесты из *MutationTest.php; все сценарии объединены с основными тестовыми классами.
Единый coverage-xml для Infection; pcov на GitHub Actions вместо xdebug.
CallableInvoker throw через container->call; max depth JSON; scan order в ContainerScanTest; CI снова на xdebug + skip-initial coverage.
Русские описания классов, методов и свойств; @param/@return/@throws; {@inheritdoc} в trait API и AbstractCompiledContainer.
Precoverage XML на runner ломает привязку тестов к строкам; на CI всегда полный initial run Infection.
Behavior-тесты вызывают pool/profiling/cache API через ContainerInternalAccess (reflection на support), чтобы PublicVisibility на CI давал KILLED, а не ERRORED.
PCOV на CI не пишет привязку строк к тестам — skip-initial-tests давал ERRORED. На GHA без precoverage включается map-source-class-to-test; порядок usePrecoverage исправлен.
На GHA precoverage с PCOV даёт ложные covered-by и ERRORED PublicVisibility; используются initial tests и map-source-class-to-test.
PCOV на GHA не связывает trait API с visibility-тестами (ERRORED PublicVisibility). Coverage для mutation: xdebug; precoverage-xml удаляется перед прогоном.
Infection выбирает PCOV при загрузенном расширении; на GHA принудительно xdebug.mode=coverage.
PCOV не связывает trait API с visibility-тестами в Infection map-source-class-to-test.
После перехода с PCOV на xdebug coverage-xml содержит covered-by; возвращён skip-initial-tests без map-source-class-to-test.
PHPDoc @Covers на методы visibility-тестов; precoverage только если coverage-xml связывает trait API с visibility-тестами. Без precoverage на GHA — map-source-class-to-test, не оба режима сразу. Co-authored-by: Cursor <cursoragent@cursor.com>
Precoverage на раннере не связывает мутанты с тестами (18 ERRORED, 59 escaped). Initial test suite + map-source-class-to-test; глобальный XDEBUG_MODE=coverage не мешает subprocess Infection. Co-authored-by: Cursor <cursoragent@cursor.com>
Локально initial test suite + line coverage даёт MSI 100% без map; на CI map ломает привязку trait API к visibility-тестам. Co-authored-by: Cursor <cursoragent@cursor.com>
Удаление phpunit cache на GHA ломало привязку мутантов к тестам (18 ERRORED). Co-authored-by: Cursor <cursoragent@cursor.com>
Мутанты на строке объявления public не покрываются line coverage; контракт public API проверяется visibility-тестами отдельно. Co-authored-by: Cursor <cursoragent@cursor.com>
Precoverage на раннере не связывает 60 мутантов с тестами (escaped/timeout). Локально GITHUB_ACTIONS=true + initial tests даёт MSI 100%. Co-authored-by: Cursor <cursoragent@cursor.com>
Precoverage после test:coverage даёт полное сопоставление строк с тестами; initial suite на CI терял covering-тесты (59 escaped). Очищаем phpunit cache перед mutation, добавляем --do-not-cache-result. Co-authored-by: Cursor <cursoragent@cursor.com>
Union covering-тестов по каждому src-файлу устраняет узкое сопоставление xdebug на CI (58 escaped). Без кэша vendor, очистка phpunit cache перед coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
Тесты unreadable-файлов для LogicalOr в loaders; opcache_reset в bootstrap для корректного применения мутантов на GHA. Co-authored-by: Cursor <cursoragent@cursor.com>
Expander подмешивает тесты по CoversClass и связанным классам Container; добавлены точечные тесты и @infection-ignore-all для эквивалентных мутантов. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ker и MethodInjector ReflectionException пробивал API-контракт (PHPDoc обещает только ContainerException). Обёрнуты 3 точки: ReflectionMethod в reflectCallableValue, invokeArgs в invokeWithArguments, Method::invoke в MethodInjector::inject. Извлечён resolveTarget() для снижения CC.
escapeshellarg склеивал «-d key=value» в один аргумент, PHP CLI не распознавал ini-директиву. Разделены на два элемента массива. Добавлен putenv XDEBUG_MODE для подавления предупреждения PHPUnit о неустановленной переменной окружения.
… ConfigurationFilesSource Исправлен тип $sources, добавлены описания свойств directory/priority/scan и paths/priority.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
minMsi/minCoveredMsi= 100%, timeout 90sreflectCallableValue(), валидация array-callable, тесты всех throw-путейAAAA-*перед.phpдля мутатораContinue_Результат локально
1161/1161 killed, 0 escaped, 0 skipped, 0 not covered
Test plan
composer infectioncomposer phpstan/composer psalm