Repository navigation
Premium Analytics: run JavaScript tests in CI - #50770
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
1ec4d6f to
9fb4708
Compare
Code Coverage Summary831 files are newly checked for coverage. Only the first 5 are listed here.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Mu Wpcom plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Premium Analytics plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
| ], | ||
| "test-php": "@composer phpunit", | ||
| "test-php-coverage": "php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\"", | ||
| "test-js": "pnpm run test", |
There was a problem hiding this comment.
Please add a test-js-coverage command too.
| "test-js": "pnpm run test", | |
| "test-js": "pnpm run test", | |
| "test-js-coverage": "pnpm run test --coverage", |
Then it looks like you'll also need to update projects/packages/premium-analytics/tests/jest.config.cjs to actually generate coverage, since the needed paths aren't in the default collectCoverageFrom.
Or maybe we should just add the additional wp-build paths to collectCoverageFrom in tools/js-tools/jest/config.coverage.js, since other projects will need them too.
P.S. You should be able to test the coverage locally with jetpack test js-coverage -v packages/premium-analytics.
There was a problem hiding this comment.
Or maybe we should just add the additional wp-build paths to
collectCoverageFromintools/js-tools/jest/config.coverage.js, since other projects will need them too.
I went ahead and did that in #50782.
9fb4708 to
55ffd9c
Compare
Related to WOOA7S-1717
Proposed changes
Premium Analytics already has a JavaScript test suite, but the package does not expose Composer
test-js/test-js-coveragescripts. The standard Jetpack JS test jobs therefore skip the package.test-jsandtest-js-coverageso the existing suite runs in CI, including under coverage.No change is needed in
projects/packages/premium-analytics/tests/jest.config.cjs: since #50782 added the wp-build paths totools/js-tools/jest/config.coverage.js, andconfig.base.jsinheritscollectCoverageFromthroughconfig.node.js, the package picks them up already.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
pnpm install --frozen-lockfile.pnpm jetpack test js packages/premium-analytics.pnpm jetpack test js-coverage -v packages/premium-analytics.packages/,routes/, andwidgets/directories rather than being empty.Nothing to modify in lock file.