Skip to content

Commit

Permalink
Allow Infection test suite to be executed in parallel using Paratest (#…
Browse files Browse the repository at this point in the history
…1544)

* 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

* Fix test, add the expected makefile help output for `test-unit-parallel`

* Set min version of `thecodingmachine/safe` to 1.1.3 because of thecodingmachine/safe#225 (fixed in 1.1.3)

* Set min version of `justinrainbow/json-schema` to 5.2.10 because of api-platform/api-platform#1712

* 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

* Fix help text indentation
  • Loading branch information
maks-rafalko committed Aug 7, 2021
1 parent 193ab76 commit 7b7a132
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 118 deletions.
6 changes: 6 additions & 0 deletions Makefile
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Expand Up @@ -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",
Expand All @@ -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"
},
Expand All @@ -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",
Expand Down

0 comments on commit 7b7a132

Please sign in to comment.