Repository navigation
Conversation
Add the three dashboards to the member list, so the navigation matrix, hover and shell-off tests cover them, and add a test of each one's primary flow. Part of JETPACK-3412
…n-shell-e2e-newsletter-protect-stats
|
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! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
…ll-e2e-newsletter-protect-stats
…ll-e2e-newsletter-protect-stats
Part of JETPACK-3412
Proposed changes
Add Newsletter, Protect and the new Stats (
packages/premium-analytics) to the admin shell e2e suite. Each one gets the navigation matrix and one test of its primary flow.This is stacked on PR 54813 and stays a draft until that PR lands. It needs that PR's CI script, the
e2e-admin-shellplugin and the one-worker phase. Trunk doesn't run this suite.Expect the admin shell job to fail for now. See "Known failures" below. No existing check was changed or excluded to hide them.
What's covered
@smoke, but the matrix rows inherit the matrix's tag.Suite changes
toplevel_page_body class. When it's on screen, the Jetpack submenu is a closed flyout, soclickMenuLink()hovers over Jetpack first.siteRest()replaces the REST call infeature-off. It uses the browser session rather than the page, so cleanup still works if the page is stuck.Site setup and what it doesn't prove
buildscript addspackages/newsletter,packages/protectandpackages/premium-analytics.subscriptions,protect-dashboardandstats.e2e-admin-shellturns onjetpack-stats-classic-page-retired. It's now on by default on this PR's base too (PR 55286). CI also marks the Stats welcome dialog as seen.e2e-premium-analytics-helperplugin, unchanged, answers Stats requests with fixtures. It also stubs the connection with its own site ID. The proxy and dashboard are real, but this doesn't prove that WordPress.com returns correct data, or that paid or WooCommerce reports work.e2e-admin-shellused to replace every other e2e plugin's WordPress.com answers with an error. It now runs after them and keeps their answers, such as the Stats fixtures and the firewall rules. Requests that no plugin answers still fail at once.Known failures
I reproduced the first three locally on a trunk build (
449a6b0a9ef), both without PR 55406 (with the shell flag on) and with its default change.headeror opt out withfalse, and its title is a breadcrumb. The test fails on Stats, now in CI too: Stats has no declared header, and the test finds no standard header title once Stats loads. The other dashboards in that test pass. In a probe that delayed the first load, the title moved 3px (58px to 55px from the top) when Stats replaced the stand-in, in 6 of 6 runs without PR 55406's default and 5 of 5 with it. This is a product bug.liston its cards, andlabel-content-name-mismatchon "View detailed stats". A plain My Jetpack load has both with the shell off too, so the shell doesn't cause them. The test failed 5 of 5 times without PR 55406's default and 4 of 5 with it. Without Stats and its fixtures, it passed 5 of 5. The test probably records its baseline before that section has loaded.a57461d8e50and passed in the re-run. The test logged four option writes from Jetpack Sync during Podcast's guest request. Sync can send as any admin request ends, and after a failed send (every send fails on this site) it waits 60 seconds. The test ended 64 seconds aftere2e-admin-shellwas activated in the run that failed, and after 42, 51 and 44 seconds in three that passed. So the wait probably ended mid-test. The log doesn't show when it started. The flag change didn't cause this: in this phase, the plugin still turns the flag on. It can happen again on a slow runner.PR 54813's fix for the shell-off smoke (
47e78d2979f) is in this branch, and that test now passes with the shell off. After each click, it finds no shell on any of the other dashboards, including Newsletter, Protect and Stats.PR 54813's branch now includes trunk at
9fadc44c2ee, and so does this one. That fixed two earlier problems: both saved-header tests now get past the saved-header check (the placeholder test passes, and the stand-in test fails only on Stats, as in item 1), and "Test plugin upgrades" passes.The axe and stale nonce tests passed in all five CI runs, so the failures in items 2 and 3 have only happened locally.
CI results and added time
CI on
a57461d8e50(Chromium, WordPress latest) ran all nine new tests, in the first run and in one re-run of the job. They all passed both times, and none was skipped. The admin shell job still fails. Not counting the login setup:The skipped tests are the SEO and Boost rows. "Test plugin upgrades" passed.
The site's PHP log also has fatal errors from
packages/videopress/src/class-stats.php, wherehttp_responseis null: 184 in the first run, and 170 onc85766173e9. The Stats fixtures are the likely cause, but I haven't confirmed that. No test failed because of them.The coverage jobs passed, but "Code coverage requirement" is still pending. It says there's no summary data for the parent commit,
47e78d29.The Protect test failed in this PR's first CI run. It has passed since I fixed the file ownership (see "Protect" above). On
c88b3017f1b, before this branch had PR 55406, the shell-off test also passed, with the new dashboards included.Based on the
c88b3017f1brun, the new tests and setup add about 38 seconds to the full job:On smoke runs, I estimate about 23 seconds. The build's extra time isn't included, and I couldn't separate it from normal variation. That doesn't include the stand-in header test's extra time. It stopped early in that run. On
a57461d8e50it took 2.8 minutes in the first run and 1.7 in the re-run, compared with 1.6 on PR 54813's47e78d2979f. I didn't compare whole job times, because they vary too much between runners.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
In the
Jetpack admin shell e2e tests (WP latest)job, check that these ran and passed, rather than being skipped:jetpack-newsletter,jetpack-protectandjetpack-premium-analytics-wp-admin, each in both directions).To run it yourself, use a build with those three packages, the modules and flag above, and the site in UTC. Turn the shell on, activate
e2e-admin-shelland thene2e-premium-analytics-helper, and dismiss the Stats welcome dialog. Only use a disposable site, since these plugins replace its connection. Inprojects/plugins/jetpack/tests/e2e, run:Run the settings tests separately with
ADMIN_SHELL_ALONE=1,--workers=1and--grep 'Newsletter keeps|Protect keeps'.What I ran, in Chromium on local WordPress Playground sites (WP 7.1.5, not Docker) with the trunk build above, without PR 55406:
CI=1and skip without it. I didn't run the two settings tests this way, but they use the same check.jetpack_admin_shell_membershook renamed, all six matrix rows failed.