Skip to content

Commit

Permalink
coverage: Always process coverage, even if tests fail (#40167)
Browse files Browse the repository at this point in the history
First, for projects that have both JS and PHP tests or multiple suites
of tests, run all the tests for coverage even if one fails. Mostly this
means using the `concurrently` package, since that's a very easy way to
run both and collect the exit statuses.

Then, in the workflow itself, add `always()` to the `if` on the step for
processing coverage reports so it runs even if the tests failed to
process whatever data is available.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11842463094

Upstream-Ref: Automattic/jetpack@bbb0564
  • Loading branch information
anomiex authored and matticbot committed Nov 14, 2024
1 parent 3669ec1 commit 8d2fbd6
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 93 deletions.
61 changes: 30 additions & 31 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions vendor/automattic/jetpack-assets/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
"phpunit": [
"./vendor/phpunit/phpunit/phpunit --colors=always"
],
"test-coverage": [
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"",
"pnpm run test-coverage"
],
"test-coverage": "pnpm concurrently --names php,js 'php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"' 'pnpm:test-coverage'",
"test-js": [
"pnpm run test"
],
Expand Down
1 change: 1 addition & 0 deletions vendor/automattic/jetpack-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"devDependencies": {
"@automattic/jetpack-webpack-config": "workspace:*",
"@wordpress/browserslist-config": "6.11.0",
"concurrently": "7.6.0",
"jest": "29.7.0",
"md5-es": "1.8.2",
"webpack": "5.94.0",
Expand Down
Loading

0 comments on commit 8d2fbd6

Please sign in to comment.