-
Notifications
You must be signed in to change notification settings - Fork 844
Add Jetpack performance testing CI infrastructure #46287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
Introduces automated LCP (Largest Contentful Paint) measurement for the wp-admin dashboard with simulated Jetpack WordPress.com connection. Key components: - Docker environment with WordPress + simulated Jetpack connection - CPU throttling calibration for consistent results across CI agents - Playwright-based LCP measurement - CodeVitals integration for metric tracking Metric posted: wp-admin-dashboard-connection-sim-largestContentfulPaint
|
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! |
- Remove outdated 4-scenario comment (only 1 scenario exists) - Remove dead baseline comparison code that never executed - Trim JSDoc to single-line descriptions across all scripts - Update eslint config to allow minimal JSDoc
Changed the Docker startup sequence to prevent race conditions where WordPress containers interfere with WP-CLI's database operations: 1. Start only the db container 2. Wait for MySQL to be ready 3. Run WP-CLI setup (WordPress container NOT running) 4. Start WordPress containers This ensures WP-CLI has exclusive database access during setup, eliminating "table doesn't exist" errors caused by concurrent access. Changes: - run-performance-tests.js: Sequential container startup - setup-wordpress.sh: Simplified (removed HTTP wait logic) - docker-compose.yml: Removed wpcli depends_on wordpress
The import plugin is not available in this context, and the base config handles import resolution. Also ensure jsdoc rules are disabled for these utility scripts.
Dependencies (playwright, dotenv) are in tools/performance/package.json, not the monorepo root, so the import resolver can't find them.
- Log calibration file path and existence - Show throttle rate, target score, calibration time, and samples - Confirm throttling is applied via CDP on first iteration
…or tools/performance
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
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. 🤷 |
…wordpress-jetpack-connected service, ensuring it starts only after the service is initiated, which helps prevent race conditions during container startup.
- Updated README.md to include new environment variables: CODEVITALS_URL, GIT_BRANCH, WP_ADMIN_USER, and WP_ADMIN_PASS. - Modified post-to-codevitals.js to streamline metric extraction by removing unused baseMetrics. - Improved run-performance-tests.js to prioritize GIT_COMMIT environment variable for git hash retrieval, ensuring accurate tracking during CI runs.
- Introduced an empty baseMetrics object in the payload to clarify that baseline normalization is not utilized in the performance metrics submission.
- Simplified browser launch to always use headless mode for consistency in performance calibration. - Removed conditional logic for headful mode, ensuring a streamlined execution in both local and CI environments.
|
Hey @anomiex👋 would you mind taking a look at this when you get a chance? This is the performance testing infrastructure I built during HACK week (more details here pc9hqz-3Rb-p2) it measures wp-admin dashboard LCP for Jetpack and posts results to CodeVitals.
The mu-plugin is probably the most relevant bit for review from a Jetpack perspective as it intercepts pre_http_request to return mock responses for various WP.com endpoints. Happy to walk through any of it if that's easier. |
anomiex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok from a monorepo perspective. I didn't look too closely at the code.
If you're wanting a review of the faked-connection stuff in the mu-plugin, @Automattic/jetpack-vulcan would be the team to ask.
|
|
||
| ## CI Usage | ||
|
|
||
| The test suite is designed to run in TeamCity. See build configuration for setup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it'd make more sense to run it in Actions rather than TeamCity, on each commit to trunk instead of backfilling weekly.
If you're running it in TeamCity, are you looking at the monorepo, or at https://github.com/Automattic/jetpack-production which has the already-built plugin?
| // Dependencies are in tools/performance/package.json, not monorepo root | ||
| // so the import resolver can't find them. Disable this rule. | ||
| 'import/no-unresolved': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't matter, eslint will look in tools/performance/node_modules for files under here.
Also, when I remove this and run eslint, it doesn't seem to complain about anything.
Addresses HOG-438: Create Jetpack Performance Tooling for LCP
Proposed changes:
tools/performance/to measure wp-admin dashboard LCP (LargestContentful Paint) with Jetpack connected
with 200ms latency)
Other information:
a script to run)?
Jetpack product discussion
pc9hqz-3Rb-p2
Does this pull request change what data or activity we track or use?
No
Testing instructions:
Prerequisites: Docker running, Node 18+, Jetpack built (
pnpm jetpack build plugins/jetpack)