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 SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
|
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.
Related to WOOA7S-1717
Proposed changes
Premium Analytics already has a JavaScript test suite, but the package does not expose a Composer
test-jsscript. The standard Jetpack JS test job therefore skips the package.test-jsso the existing suite runs in CI.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.Nothing to modify in lock file.