Skip to content

Commit 51c31f7

Browse files
authored
Speed up tests with parallel execution (#335)
1 parent e6b6e71 commit 51c31f7

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/part_test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ jobs:
7373
if: matrix.php == 'nightly'
7474
run: composer install --prefer-dist --ignore-platform-req=php+
7575
- name: Run PHPUnit
76-
run: composer run test:unit
77-
env:
78-
XDEBUG_MODE: coverage
76+
run: composer run test:unit:cov
7977
- name: Upload coverage results to Coveralls
8078
env:
8179
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"mikey179/vfsstream": "^1.6",
3434
"php-coveralls/php-coveralls": "^2.5",
3535
"friendsofphp/php-cs-fixer": "^3.16",
36-
"vimeo/psalm": "^6.0"
36+
"vimeo/psalm": "^6.0",
37+
"brianium/paratest": "^7.7"
3738
},
3839
"suggest": {
3940
"psr/http-message": "^2.0",
@@ -46,9 +47,13 @@
4647
"@test:formatted",
4748
"@test:lint"
4849
],
49-
"test:unit": "phpunit --coverage-clover=coverage.clover.xml --coverage-html cov",
50+
"test:unit:setup-cov": "@putenv XDEBUG_MODE=coverage",
51+
"test:unit": "paratest --functional",
52+
"test:unit:cov": ["@test:unit:setup-cov", "@test:unit --coverage-clover=coverage.clover.xml --coverage-html cov"],
5053
"test:unit:slow": "@test:unit --group slow",
54+
"test:unit:slow:cov": ["@test:unit:setup-cov", "@test:unit --coverage-clover=coverage.clover.xml --coverage-html cov --group slow"],
5155
"test:unit:fast": "@test:unit --exclude-group slow",
56+
"test:unit:fast:cov": ["@test:unit:setup-cov", "@test:unit --coverage-clover=coverage.clover.xml --coverage-html cov --exclude-group slow"],
5257
"test:formatted": "@format --dry-run --stop-on-violation --using-cache=no",
5358
"test:lint": "psalm --stats --show-info=true --find-unused-psalm-suppress",
5459
"coverage:report": "php-coveralls --coverage_clover=coverage.clover.xml --json_path=coveralls-upload.json --insecure",

0 commit comments

Comments
 (0)