Skip to content

Commit 8d2fbd6

Browse files
anomiexmatticbot
authored andcommitted
coverage: Always process coverage, even if tests fail (#40167)
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
1 parent 3669ec1 commit 8d2fbd6

File tree

5 files changed

+89
-93
lines changed

5 files changed

+89
-93
lines changed

composer.lock

+30-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/automattic/jetpack-assets/composer.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@
3434
"phpunit": [
3535
"./vendor/phpunit/phpunit/phpunit --colors=always"
3636
],
37-
"test-coverage": [
38-
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"",
39-
"pnpm run test-coverage"
40-
],
37+
"test-coverage": "pnpm concurrently --names php,js 'php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"' 'pnpm:test-coverage'",
4138
"test-js": [
4239
"pnpm run test"
4340
],

vendor/automattic/jetpack-assets/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"devDependencies": {
1919
"@automattic/jetpack-webpack-config": "workspace:*",
2020
"@wordpress/browserslist-config": "6.11.0",
21+
"concurrently": "7.6.0",
2122
"jest": "29.7.0",
2223
"md5-es": "1.8.2",
2324
"webpack": "5.94.0",

0 commit comments

Comments
 (0)