From 3af972144a96b6d43fc8ef03612a25ef7a7825f6 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Fri, 6 Aug 2021 01:30:25 +0300 Subject: [PATCH 1/6] Allow Infection test suite to be executed in parallel using Paratest 2 goals here: 1. This is much faster (5 seconds for `vendor/bin/paratest` instead of 24 seconds for `vendor/bin/phpunit`) 2. This is the first step for supporting new Test Framework Adapter - Paratest, to run initial tests suite run using `paratest` instead of `phpunit` For now, just for the local usage --- Makefile | 6 + composer.json | 1 + composer.lock | 304 ++++++++++++------ devTools/phpstan-src.neon | 2 - src/Command/RunCommand.php | 2 +- .../phpunit/FileSystem/FileSystemTestCase.php | 11 +- 6 files changed, 218 insertions(+), 108 deletions(-) diff --git a/Makefile b/Makefile index 6c8c419ff..37c6b9683 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ PSALM=./.tools/psalm PSALM_URL="https://github.com/vimeo/psalm/releases/download/4.1.1/psalm.phar" PHPUNIT=vendor/phpunit/phpunit/phpunit +PARATEST=vendor/bin/paratest --runner=WrapperRunner INFECTION=./build/infection.phar @@ -133,6 +134,11 @@ test-unit: ## Runs the unit tests test-unit: $(PHPUNIT) $(PHPUNIT) --group $(PHPUNIT_GROUP) +.PHONY: test-unit-parallel +test-unit-parallel: ## Runs the unit tests in parallel +test-unit-parallel: + $(PARATEST) + .PHONY: test-unit-docker test-unit-docker: ## Runs the unit tests on the different Docker platforms test-unit-docker: test-unit-74-docker test-unit-80-docker diff --git a/composer.json b/composer.json index a6ab6d0ab..4888c4001 100644 --- a/composer.json +++ b/composer.json @@ -72,6 +72,7 @@ }, "require-dev": { "ext-simplexml": "*", + "brianium/paratest": "^6.3", "helmich/phpunit-json-assert": "^3.0", "phpspec/prophecy-phpunit": "^2.0", "phpstan/extension-installer": "^1.0", diff --git a/composer.lock b/composer.lock index 5296a906f..a89ebfef4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "111714ccf74328b5596fcd2cf3f3e202", + "content-hash": "be9fac6a2742679c20af6db92d3f4f88", "packages": [ { "name": "composer/xdebug-handler", @@ -837,27 +837,29 @@ }, { "name": "symfony/console", - "version": "v5.2.1", + "version": "v5.3.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "47c02526c532fb381374dab26df05e7313978976" + "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/47c02526c532fb381374dab26df05e7313978976", - "reference": "47c02526c532fb381374dab26df05e7313978976", + "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2", "symfony/string": "^5.1" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<4.4", "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", @@ -865,10 +867,10 @@ "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/event-dispatcher": "^4.4|^5.0", @@ -905,7 +907,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "keywords": [ "cli", @@ -914,7 +916,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.2.1" + "source": "https://github.com/symfony/console/tree/v5.3.6" }, "funding": [ { @@ -930,7 +932,74 @@ "type": "tidelift" } ], - "time": "2020-12-18T08:03:05+00:00" + "time": "2021-07-27T19:10:22+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/master" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" }, { "name": "symfony/filesystem", @@ -1543,21 +1612,21 @@ }, { "name": "symfony/process", - "version": "v5.2.1", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "bd8815b8b6705298beaa384f04fabd459c10bedd" + "reference": "d16634ee55b895bd85ec714dadc58e4428ecf030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/bd8815b8b6705298beaa384f04fabd459c10bedd", - "reference": "bd8815b8b6705298beaa384f04fabd459c10bedd", + "url": "https://api.github.com/repos/symfony/process/zipball/d16634ee55b895bd85ec714dadc58e4428ecf030", + "reference": "d16634ee55b895bd85ec714dadc58e4428ecf030", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -1582,10 +1651,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.2.1" + "source": "https://github.com/symfony/process/tree/v5.3.4" }, "funding": [ { @@ -1601,7 +1670,7 @@ "type": "tidelift" } ], - "time": "2020-12-08T17:03:37+00:00" + "time": "2021-07-23T15:54:19+00:00" }, { "name": "symfony/service-contracts", @@ -2009,6 +2078,100 @@ } ], "packages-dev": [ + { + "name": "brianium/paratest", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/paratestphp/paratest.git", + "reference": "268d5b2b4237c0abf76c4aa9633ad8580be01e1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/268d5b2b4237c0abf76c4aa9633ad8580be01e1e", + "reference": "268d5b2b4237c0abf76c4aa9633ad8580be01e1e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-simplexml": "*", + "php": "^7.3 || ^8.0", + "phpunit/php-code-coverage": "^9.2.6", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-timer": "^5.0.3", + "phpunit/phpunit": "^9.5.4", + "sebastian/environment": "^5.1.3", + "symfony/console": "^4.4.21 || ^5.2.6", + "symfony/process": "^4.4.21 || ^5.2.4" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0.0", + "ekino/phpstan-banned-code": "^0.4.0", + "ergebnis/phpstan-rules": "^0.15.3", + "ext-posix": "*", + "infection/infection": "^0.21.5", + "phpstan/phpstan": "^0.12.84", + "phpstan/phpstan-deprecation-rules": "^0.12.6", + "phpstan/phpstan-phpunit": "^0.12.18", + "phpstan/phpstan-strict-rules": "^0.12.9", + "squizlabs/php_codesniffer": "^3.6.0", + "symfony/filesystem": "^5.2.6", + "thecodingmachine/phpstan-strict-rules": "^0.12.1", + "vimeo/psalm": "^4.7.1" + }, + "bin": [ + "bin/paratest" + ], + "type": "library", + "autoload": { + "psr-4": { + "ParaTest\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Scaturro", + "email": "scaturrob@gmail.com", + "role": "Developer" + }, + { + "name": "Filippo Tessarotto", + "email": "zoeslam@gmail.com", + "role": "Developer" + } + ], + "description": "Parallel testing for PHP", + "homepage": "https://github.com/paratestphp/paratest", + "keywords": [ + "concurrent", + "parallel", + "phpunit", + "testing" + ], + "support": { + "issues": "https://github.com/paratestphp/paratest/issues", + "source": "https://github.com/paratestphp/paratest/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/Slamdunk", + "type": "github" + }, + { + "url": "https://paypal.me/filippotessarotto", + "type": "paypal" + } + ], + "time": "2021-04-27T09:24:27+00:00" + }, { "name": "doctrine/instantiator", "version": "1.4.0", @@ -2848,16 +3011,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.5", + "version": "9.2.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1" + "reference": "f6293e1b30a2354e8428e004689671b83871edde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1", - "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", + "reference": "f6293e1b30a2354e8428e004689671b83871edde", "shasum": "" }, "require": { @@ -2913,7 +3076,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" }, "funding": [ { @@ -2921,7 +3084,7 @@ "type": "github" } ], - "time": "2020-11-28T06:44:49+00:00" + "time": "2021-03-28T07:26:59+00:00" }, { "name": "phpunit/php-file-iterator", @@ -3166,16 +3329,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.0", + "version": "9.5.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe" + "reference": "c73c6737305e779771147af66c96ca6a7ed8a741" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", - "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c73c6737305e779771147af66c96ca6a7ed8a741", + "reference": "c73c6737305e779771147af66c96ca6a7ed8a741", "shasum": "" }, "require": { @@ -3253,7 +3416,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.0" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.4" }, "funding": [ { @@ -3265,7 +3428,7 @@ "type": "github" } ], - "time": "2020-12-04T05:05:53+00:00" + "time": "2021-03-23T07:16:29+00:00" }, { "name": "sebastian/cli-parser", @@ -4232,73 +4395,6 @@ ], "time": "2020-10-27T11:37:08+00:00" }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/master" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-09-07T11:33:47+00:00" - }, { "name": "symfony/phpunit-bridge", "version": "v5.2.1", @@ -4516,16 +4612,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { @@ -4554,7 +4650,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" }, "funding": [ { @@ -4562,7 +4658,7 @@ "type": "github" } ], - "time": "2020-07-12T23:59:07+00:00" + "time": "2021-07-28T10:34:58+00:00" } ], "aliases": [], diff --git a/devTools/phpstan-src.neon b/devTools/phpstan-src.neon index 31f399d0b..41b508904 100644 --- a/devTools/phpstan-src.neon +++ b/devTools/phpstan-src.neon @@ -8,8 +8,6 @@ parameters: ignoreErrors: - '#.* value type specified in iterable type Symfony\\Component\\Process\\Process#' - '#generic class ReflectionClass (but )?does not specify its types#' - - '#expects .*, array\|bool\|string\|null given#' - - '#cast array\|bool\|string\|null to#' - path: '../src/PhpParser/FileParser.php' message: '#Method Infection\\PhpParser\\FileParser::parse\(\) should return array but returns array\|null\.#' diff --git a/src/Command/RunCommand.php b/src/Command/RunCommand.php index 34483a165..3768b0282 100644 --- a/src/Command/RunCommand.php +++ b/src/Command/RunCommand.php @@ -485,7 +485,7 @@ private function startUp( ): void { $locator = $container->getRootsFileOrDirectoryLocator(); - if ($customConfigPath = (string) $io->getInput()->getOption(self::OPTION_CONFIGURATION)) { + if (($customConfigPath = (string) $io->getInput()->getOption(self::OPTION_CONFIGURATION)) !== '') { $locator->locate($customConfigPath); } else { $this->runConfigurationCommand($locator, $io); diff --git a/tests/phpunit/FileSystem/FileSystemTestCase.php b/tests/phpunit/FileSystem/FileSystemTestCase.php index 7e0876c5d..6885cfbd7 100644 --- a/tests/phpunit/FileSystem/FileSystemTestCase.php +++ b/tests/phpunit/FileSystem/FileSystemTestCase.php @@ -35,11 +35,13 @@ namespace Infection\Tests\FileSystem; +use function getenv; use function Infection\Tests\make_tmp_dir; use function Infection\Tests\normalizePath; use PHPUnit\Framework\TestCase; use function Safe\getcwd; use function Safe\realpath; +use function Safe\sprintf; use Symfony\Component\Filesystem\Filesystem; use function sys_get_temp_dir; @@ -84,9 +86,16 @@ protected function tearDown(): void final protected static function removeTmpDir(): void { + $testToken = getenv('TEST_TOKEN'); + (new Filesystem())->remove( normalizePath( - realpath(sys_get_temp_dir()) . '/' . self::TMP_DIR_NAME + sprintf( + '%s/%s/%s', + realpath(sys_get_temp_dir()), + self::TMP_DIR_NAME, + $testToken === false || $testToken === '' ? '1' : $testToken + ) ) ); } From 0b22bf277b69ae4ae4cfdb3f276df3b58c44ccd8 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Fri, 6 Aug 2021 01:36:34 +0300 Subject: [PATCH 2/6] Fix test, add the expected makefile help output for `test-unit-parallel` --- tests/phpunit/AutoReview/Makefile/MakefileTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/phpunit/AutoReview/Makefile/MakefileTest.php b/tests/phpunit/AutoReview/Makefile/MakefileTest.php index a015b6b89..060b73785 100644 --- a/tests/phpunit/AutoReview/Makefile/MakefileTest.php +++ b/tests/phpunit/AutoReview/Makefile/MakefileTest.php @@ -85,6 +85,7 @@ public function test_the_default_goal_is_the_help_command(): void test: Runs all the tests test-docker: Runs all the tests on the different Docker platforms test-unit: Runs the unit tests +test-unit-parallel: Runs the unit tests in parallel test-unit-docker: Runs the unit tests on the different Docker platforms test-e2e: Runs the end-to-end tests test-e2e-phpunit: Runs PHPUnit-enabled subset of end-to-end tests From 0724e71d0274b63e72a20539700b94faf111fd64 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Fri, 6 Aug 2021 02:07:07 +0300 Subject: [PATCH 3/6] Set min version of `thecodingmachine/safe` to 1.1.3 because of https://github.com/thecodingmachine/safe/issues/225 (fixed in 1.1.3) --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 4888c4001..4d3ca4115 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,7 @@ "symfony/filesystem": "^3.4.29 || ^4.1.19 || ^5.0", "symfony/finder": "^3.4.29 || ^4.1.19 || ^5.0", "symfony/process": "^3.4.29 || ^4.1.19 || ^5.0", - "thecodingmachine/safe": "^1.0", + "thecodingmachine/safe": "^1.1.3", "webmozart/assert": "^1.3", "webmozart/path-util": "^2.3" }, diff --git a/composer.lock b/composer.lock index a89ebfef4..7dfc5cf30 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "be9fac6a2742679c20af6db92d3f4f88", + "content-hash": "28bfff34ef35e60b32f947f082884021", "packages": [ { "name": "composer/xdebug-handler", From 097ff367610da117cb244bb6c14b5cb384c59122 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Fri, 6 Aug 2021 02:16:44 +0300 Subject: [PATCH 4/6] Set min version of `justinrainbow/json-schema` to 5.2.10 because of https://github.com/api-platform/api-platform/issues/1712 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 4d3ca4115..c66f40706 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "infection/abstract-testframework-adapter": "^0.3.1", "infection/extension-installer": "^0.1.0", "infection/include-interceptor": "^0.2.4", - "justinrainbow/json-schema": "^5.2", + "justinrainbow/json-schema": "^5.2.10", "nikic/php-parser": "^4.10.3", "ocramius/package-versions": "^1.9.0 || ^2.0", "ondram/ci-detector": "^3.3.0", diff --git a/composer.lock b/composer.lock index 7dfc5cf30..89b035c5a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "28bfff34ef35e60b32f947f082884021", + "content-hash": "e386c963bbc78549523114db79bcb94c", "packages": [ { "name": "composer/xdebug-handler", @@ -219,16 +219,16 @@ }, { "name": "justinrainbow/json-schema", - "version": "5.2.10", + "version": "5.2.11", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ab6744b7296ded80f8cc4f9509abbff393399aa", + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa", "shasum": "" }, "require": { @@ -283,9 +283,9 @@ ], "support": { "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.10" + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.11" }, - "time": "2020-05-27T16:41:55+00:00" + "time": "2021-07-22T09:24:00+00:00" }, { "name": "nikic/php-parser", From 3e53bcb2d4edd9bd5cd90238046b0f70c87abef0 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Fri, 6 Aug 2021 02:38:12 +0300 Subject: [PATCH 5/6] Call `$process->inheritEnvironmentVariables();` only when it exists and is not deprecated Otherwise, it does not make sense because starting from `syfmony/console` 4.4 environment variable are inhereted automatically, and calling deprecated methods fails the tests --- src/Process/Factory/InitialTestsRunProcessFactory.php | 4 +++- src/Process/Factory/MutantProcessFactory.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Process/Factory/InitialTestsRunProcessFactory.php b/src/Process/Factory/InitialTestsRunProcessFactory.php index 934022471..479b97bfb 100644 --- a/src/Process/Factory/InitialTestsRunProcessFactory.php +++ b/src/Process/Factory/InitialTestsRunProcessFactory.php @@ -38,7 +38,9 @@ use Infection\AbstractTestFramework\TestFrameworkAdapter; use Infection\Process\OriginalPhpProcess; use function method_exists; +use PackageVersions\Versions; use Symfony\Component\Process\Process; +use function version_compare; /** * @internal @@ -77,7 +79,7 @@ public function createProcess( $process->setTimeout(null); // Ignore the default timeout of 60 seconds - if (method_exists($process, 'inheritEnvironmentVariables')) { + if (method_exists($process, 'inheritEnvironmentVariables') && version_compare(Versions::getVersion('symfony/console'), 'v4.4', '<')) { // In version 4.4.0 this method is deprecated and removed in 5.0.0 $process->inheritEnvironmentVariables(); } diff --git a/src/Process/Factory/MutantProcessFactory.php b/src/Process/Factory/MutantProcessFactory.php index 2af0b309c..c41238be6 100644 --- a/src/Process/Factory/MutantProcessFactory.php +++ b/src/Process/Factory/MutantProcessFactory.php @@ -42,7 +42,9 @@ use Infection\Mutant\MutantExecutionResultFactory; use Infection\Process\MutantProcess; use function method_exists; +use PackageVersions\Versions; use Symfony\Component\Process\Process; +use function version_compare; /** * @internal @@ -82,7 +84,7 @@ public function createProcessForMutant(Mutant $mutant, string $testFrameworkExtr $process->setTimeout($this->timeout); - if (method_exists($process, 'inheritEnvironmentVariables')) { + if (method_exists($process, 'inheritEnvironmentVariables') && version_compare(Versions::getVersion('symfony/console'), 'v4.4', '<')) { // in version 4.4.0 this method is deprecated and removed in 5.0.0 $process->inheritEnvironmentVariables(); } From 1a3c611bf762004de8a64519fac60abb53390807 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sat, 7 Aug 2021 19:13:46 +0300 Subject: [PATCH 6/6] Fix help text indentation --- Makefile | 2 +- tests/phpunit/AutoReview/Makefile/MakefileTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 37c6b9683..98226e098 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ test-unit: $(PHPUNIT) $(PHPUNIT) --group $(PHPUNIT_GROUP) .PHONY: test-unit-parallel -test-unit-parallel: ## Runs the unit tests in parallel +test-unit-parallel: ## Runs the unit tests in parallel test-unit-parallel: $(PARATEST) diff --git a/tests/phpunit/AutoReview/Makefile/MakefileTest.php b/tests/phpunit/AutoReview/Makefile/MakefileTest.php index 060b73785..825ad6138 100644 --- a/tests/phpunit/AutoReview/Makefile/MakefileTest.php +++ b/tests/phpunit/AutoReview/Makefile/MakefileTest.php @@ -85,7 +85,7 @@ public function test_the_default_goal_is_the_help_command(): void test: Runs all the tests test-docker: Runs all the tests on the different Docker platforms test-unit: Runs the unit tests -test-unit-parallel: Runs the unit tests in parallel +test-unit-parallel: Runs the unit tests in parallel test-unit-docker: Runs the unit tests on the different Docker platforms test-e2e: Runs the end-to-end tests test-e2e-phpunit: Runs PHPUnit-enabled subset of end-to-end tests