infection / infection

PHP Mutation Testing library
https://infection.github.io
BSD 3-Clause "New" or "Revised" License
2.03k stars 158 forks source link

Clean project ApiPlatform + PhpUnit 11 + PHP 8.3.x -> nikic/php-parser minimum version bump needed #1918

Closed rkeet closed 5 months ago

rkeet commented 5 months ago

Problem:

Unable to install latest infection/infection due to non-yet upgraded support for latest nikic/php-parser dependency

Fix:

Out of scope of report

Because I didn't see an Issue for this I thought to create it. Unfortunately, I don't have time to fully flesh out/fix the issues or perform the upgrade and create a PR, otherwise I might look into it a bit.

General info

Question Answer
Infection version Latest - attempted installation fails
Test Framework version PhpUnit 11.0.6
PHP version 8.3.4
Platform Windows + WSL Ubuntu 22.04.4 LTS, but also php:8.3.4-cli-alpine3.19 Docker image
Github Repo Related: nikic/php-parser (infection dependency)

Reproduce

composer.json ```json { "type": "project", "license": "proprietary", "minimum-stability": "stable", "prefer-stable": true, "require": { "php": ">=8.3", "ext-ctype": "*", "ext-iconv": "*", "api-platform/core": "^3.2", "doctrine/dbal": "^3", "doctrine/doctrine-bundle": "^2.11", "doctrine/doctrine-migrations-bundle": "^3.3", "doctrine/orm": "^3.1", "nelmio/cors-bundle": "^2.4", "phpdocumentor/reflection-docblock": "^5.3", "phpstan/phpdoc-parser": "^1.26", "symfony/asset": "^7.0", "symfony/console": "^7.0", "symfony/dotenv": "^7.0", "symfony/expression-language": "^7.0", "symfony/flex": "^2", "symfony/framework-bundle": "^7.0", "symfony/property-access": "^7.0", "symfony/property-info": "^7.0", "symfony/runtime": "^7.0", "symfony/security-bundle": "^7.0", "symfony/serializer": "^7.0", "symfony/twig-bundle": "^7.0", "symfony/validator": "^7.0", "symfony/yaml": "^7.0", "webonyx/graphql-php": "^15.11" }, "require-dev": { "phpunit/phpunit": "^11.0", "roave/security-advisories": "dev-latest", "squizlabs/php_codesniffer": "^3.9", "symfony/phpunit-bridge": "^7.0" }, "config": { "allow-plugins": { "php-http/discovery": true, "symfony/flex": true, "symfony/runtime": true }, "sort-packages": true }, "autoload": { "psr-4": { "App\\": "src/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "replace": { "symfony/polyfill-ctype": "*", "symfony/polyfill-iconv": "*", "symfony/polyfill-php72": "*", "symfony/polyfill-php73": "*", "symfony/polyfill-php74": "*", "symfony/polyfill-php80": "*", "symfony/polyfill-php81": "*", "symfony/polyfill-php82": "*" }, "scripts": { "auto-scripts": { "cache:clear": "symfony-cmd", "assets:install %PUBLIC_DIR%": "symfony-cmd" }, "post-install-cmd": [ "@auto-scripts" ], "post-update-cmd": [ "@auto-scripts" ] }, "conflict": { "symfony/symfony": "*" }, "extra": { "symfony": { "allow-contrib": false, "require": "^7.0" } } } ```

PhpUnit config - defaults minus non-working config from default template

phpunit.xml ```xml tests ```

Attempted infection installation (composer require --dev) output

Highlight line:

- infection/infection[0.26.17, ..., 0.27.10] require nikic/php-parser ^4.15.1 -> found nikic/php-parser[v4.15.1, ..., v4.19.1] but the package is fixed to v5.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Output with issue ```shell me@my-pc: ~/api (main)$ composer require --dev infection/infection ./composer.json has been updated Running composer update infection/infection Loading composer repositories with package information Restricting packages listed in "symfony/symfony" to "^7.0" Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - infection/infection[0.1.0, ..., 0.9.3] require php ^7.0 -> your php version (8.3.4) does not satisfy that requirement. - infection/infection[0.10.0, ..., 0.11.5] require php ^7.1 -> your php version (8.3.4) does not satisfy that requirement. - infection/infection[0.12.0, ..., 0.13.6] require php ^7.1.3 -> your php version (8.3.4) does not satisfy that requirement. - infection/infection[0.14.0, ..., 0.15.3] require php ^7.2.9 -> your php version (8.3.4) does not satisfy that requirement. - infection/infection[0.16.0, ..., 0.18.1] require php ^7.3 -> your php version (8.3.4) does not satisfy that requirement. - infection/infection[0.18.2, ..., 0.20.2] require nikic/php-parser ^4.10.2 -> found nikic/php-parser[v4.10.2, ..., v4.19.1] but the package is fixed to v5.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - infection/infection[0.21.0, ..., 0.25.3] require nikic/php-parser ^4.10.3 -> found nikic/php-parser[v4.10.3, ..., v4.19.1] but the package is fixed to v5.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - infection/infection[0.25.4, ..., 0.26.3] require nikic/php-parser ^4.13 -> found nikic/php-parser[v4.13.0, ..., v4.19.1] but the package is fixed to v5.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - infection/infection[0.26.4, ..., 0.26.16] require nikic/php-parser ^4.13.2 -> found nikic/php-parser[v4.13.2, ..., v4.19.1] but the package is fixed to v5.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - infection/infection[0.26.17, ..., 0.27.10] require nikic/php-parser ^4.15.1 -> found nikic/php-parser[v4.15.1, ..., v4.19.1] but the package is fixed to v5.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - Root composer.json requires infection/infection * -> satisfiable by infection/infection[0.1.0, ..., 0.27.10]. Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions. You can also try re-running composer require with an explicit version constraint, e.g. "composer require infection/infection:*" to figure out if any version is installable, or "composer require infection/infection:^2.1" if you know which you need. Installation failed, reverting ./composer.json and ./composer.lock to their original content. ```
maks-rafalko commented 5 months ago

Hello, adding support for nikic/php-parser:^5 is in progress and can be tracked here: https://github.com/infection/infection/pull/1909

Meanwhile, you have 2 options:

rkeet commented 5 months ago

Ah, thank you! 😄 Have subscribed for updates! 👍

maks-rafalko commented 5 months ago

Released https://github.com/infection/infection/releases/tag/0.28.0