Skip to content

Commit

Permalink
Improve test suite by adding "composer run multicover"
Browse files Browse the repository at this point in the history
This will aid on running the tests with coverage on both PHP7 and PHP8,
merge coverage reports and render them as HTML to be inspected by
humans.

It's not completely maintenance free because some paths will probably
have to be adjusted for others, but it's way better than nothing.
  • Loading branch information
amotl committed Feb 25, 2021
1 parent 8ebeb75 commit 035f9b5
Show file tree
Hide file tree
Showing 4 changed files with 925 additions and 6 deletions.
18 changes: 14 additions & 4 deletions DEVELOP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ Installation

Install prerequisites::

# Install different PHP releases.
brew install [email protected] [email protected] [email protected] composer
# Install different PHP releases and Composer.
brew install [email protected] [email protected] [email protected] brew-php-switcher composer

# Select PHP version.
brew-php-switcher 7.3
brew-php-switcher 7.4
brew-php-switcher 8.0

# Install xdebug extension for tracking code coverage.
# Install `xdebug` extension into each environment for tracking code coverage.
pecl install xdebug

Get the sources::
Expand All @@ -113,9 +113,19 @@ Running the Tests
--mount type=bind,source=$PWD/test/provisioning/truststore,target=/vagrant/test/provisioning/truststore \
--publish 4200:4200 --publish 5432:5432 crate/crate:nightly

# Run test suite
# Run test suite on current/default version of PHP
composer run test

# Run tests on both PHP7 and PHP8 to get the full picture of coverage
composer run multicover
open build/multicover/html/index.html


Invoke code style checks
========================

::

# Run code style checks
composer run check-style

Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^0.12",
"squizlabs/php_codesniffer": "^3.5"
"squizlabs/php_codesniffer": "^3.5",
"nimut/phpunit-merger": "^1.1"
},
"autoload-dev": {
"psr-0": {
Expand All @@ -35,6 +36,8 @@
},
"scripts": {
"test": "XDEBUG_MODE=coverage phpunit --coverage-clover build/logs/clover.xml",
"coverage-html": "XDEBUG_MODE=coverage phpunit --coverage-html build/logs/html",
"multicover": "./devtools/php-multicover.sh",
"check-style": "phpcs",
"fix-style": "phpcbf"
}
Expand Down
Loading

0 comments on commit 035f9b5

Please sign in to comment.