Skip to content

Commit

Permalink
Monorepo: Restore and add test coverage config (#39961)
Browse files Browse the repository at this point in the history
* Enable and normalize test coverage commands

* Revert "Code Coverage: remove automation (#28542)"

This reverts commit da5e78803f56ea0fe54f29720c05be037093b97a.

* Revert "Remove remnants of automated code coverage support (#28982)"

This reverts commit 8cc32461b2d3b7e3a4a391c033163e5ebc3822fa.

* Fix starter plugin test broken by #31417

* Plugin tests are now run in the monorepo rather than wp-content/plugins.

* Removed undocumented WP_DEVELOP_DIR variable, documented WORDPRESS_DEVELOP_DIR and WORDPRESS_DIR

* Fixed JS tests in some packages where .scripts.test-js had never been added to composer.json.

---------

Co-authored-by: Brad Jorsch <brad.jorsch@automattic.com>

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

Upstream-Ref: Automattic/jetpack@7fadf4a
  • Loading branch information
tbradsha authored and matticbot committed Oct 31, 2024
1 parent be5be20 commit 1b6a746
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.22.3-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Added
- Enable test coverage.

## [0.22.2] - 2024-10-29
### Changed
- Internal updates. [#39263]
Expand Down Expand Up @@ -398,6 +405,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Core: do not ship .phpcs.dir.xml in production builds.

[0.22.3-alpha]: https://github.com/Automattic/jetpack-waf/compare/v0.22.2...v0.22.3-alpha
[0.22.2]: https://github.com/Automattic/jetpack-waf/compare/v0.22.1...v0.22.2
[0.22.1]: https://github.com/Automattic/jetpack-waf/compare/v0.22.0...v0.22.1
[0.22.0]: https://github.com/Automattic/jetpack-waf/compare/v0.21.0...v0.22.0
Expand Down
14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^5.1.5",
"automattic/jetpack-constants": "^2.0.4",
"automattic/jetpack-ip": "^0.3.0",
"automattic/jetpack-status": "^4.0.2",
"automattic/jetpack-connection": "^5.1.6-alpha",
"automattic/jetpack-constants": "^2.0.5-alpha",
"automattic/jetpack-ip": "^0.3.1-alpha",
"automattic/jetpack-status": "^4.0.3-alpha",
"wikimedia/aho-corasick": "^1.0"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
"automattic/jetpack-changelogger": "^4.2.7",
"automattic/jetpack-changelogger": "^4.2.8-alpha",
"automattic/wordbless": "@dev"
},
"suggest": {
Expand All @@ -34,6 +34,10 @@
],
"post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy",
"post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy",
"test-coverage": [
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-clover \"$COVERAGE_DIR/integration/clover.xml\" --configuration tests/php/integration/phpunit.xml.dist",
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-clover \"$COVERAGE_DIR/unit/clover.xml\" --configuration tests/php/unit/phpunit.xml.dist"
],
"test-coverage-html": [
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-html ./coverage --configuration tests/php/integration/phpunit.xml.dist",
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-html ./coverage --configuration tests/php/unit/phpunit.xml.dist"
Expand Down

0 comments on commit 1b6a746

Please sign in to comment.