Skip to content

Premium Analytics: run JavaScript tests in CI#50770

Open
chihsuan wants to merge 1 commit into
trunkfrom
chore/premium-analytics-enable-js-tests
Open

Premium Analytics: run JavaScript tests in CI#50770
chihsuan wants to merge 1 commit into
trunkfrom
chore/premium-analytics-enable-js-tests

Conversation

@chihsuan

Copy link
Copy Markdown
Member

Related to WOOA7S-1717

Proposed changes

Premium Analytics already has a JavaScript test suite, but the package does not expose a Composer test-js script. The standard Jetpack JS test job therefore skips the package.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  1. Run pnpm install --frozen-lockfile.
  2. Run pnpm jetpack test js packages/premium-analytics.
  3. Confirm all Premium Analytics JavaScript tests pass.
  4. Run the Composer monorepo update tool for the Premium Analytics, mu-wpcom-plugin, and wpcomsh plugin lockfiles.
  5. Confirm each reports Nothing to modify in lock file.

@chihsuan
chihsuan requested review from a team as code owners July 23, 2026 09:26
@chihsuan chihsuan added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. labels Jul 23, 2026
@chihsuan chihsuan self-assigned this Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (WordPress.com Site Helper), and enable the chore/premium-analytics-enable-js-tests branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack-mu-wpcom-plugin chore/premium-analytics-enable-js-tests

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@chihsuan
chihsuan force-pushed the chore/premium-analytics-enable-js-tests branch from 1ec4d6f to 9fb4708 Compare July 23, 2026 09:28
@jp-launch-control

jp-launch-control Bot commented Jul 23, 2026

Copy link
Copy Markdown

Code Coverage Summary

This 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. 🤷

Full summary · PHP report · JS report

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test-js-coverage command too.

Suggested change
"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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

I went ahead and did that in #50782.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Package] Premium Analytics [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Premium Analytics [Plugin] Wpcomsh [Status] Needs Review This PR is ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants