Skip to content

Improve Test Performance - #1199

Draft
n7studios wants to merge 3 commits into
improve-test-reliabilityfrom
improve-test-performance
Draft

n7studios wants to merge 3 commits into
improve-test-reliabilityfrom
improve-test-performance

Conversation

@n7studios

@n7studios n7studios commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Reduces end-to-end test suite runtime, with no change to Plugin functionality.

Tests: 676 → 644

Removed tests that duplicate coverage elsewhere:

  • Cache/optimisation Plugin tests existed in four Cests. The block and shortcode versions both cover an inline Form; the Block Editor and Classic Editor versions both cover a modal Form. Removed the duplicate of each pair, keeping PageBlockFormPerformancePluginsCest (inline) and BlockEditorFormCest (modal).
  • Default Form position tests in ClassicEditorFormCest duplicated BlockEditorFormCest, as the position logic runs on the_content and is editor independent. Kept testAddNewPostTypeUsingDefaultFormAfterParagraphElement, as the Classic Editor's content is generated by wpautop() and the Block Editor's by do_blocks(), which can produce a different number of elements.
  • Refresh button tests for the Form Trigger and Product blocks/shortcodes duplicated the Form ones. Kept one block, one Visual Editor modal and one Text Editor modal.
  • ImportWhenNoKitForms existed in all seven importer Cests for the same shared code path. Kept on PluginSettingsToolsImporterActiveCampaignCest.

24 shortcode tests now assert the shortcode built by the Visual or Text Editor modal and stop there, instead of also publishing and viewing the Page. Both modals assert the same expected shortcode, and the block and shortcode share the same render() method, so the frontend output is already covered by the block's test. Adds clearClassicEditorUnsavedChangesWarning(), which clears WordPress' beforeunload handlers so navigating away from the unpublished Page doesn't display a browser dialog.

GitHub Actions

  • Each test group now installs only the third party Plugins and Themes its tests activate, defined in the matrix, instead of every job installing all of them. Divi 5 is now only installed for integrations/divi-theme, and uncode and impeka only for restrict-content/post-types.
  • wordpress-seo and wpforms-lite are no longer installed, as no test activates them.
  • Added a build-assets job that runs npm ci && npm run build once and uploads the built CSS and JS. Test jobs download that artifact instead of running npm.
  • composer update is now composer install, so every job installs the versions in composer.lock.
  • npm run build no longer runs the CSS and JS linters, which were running in every test job. Linting is now npm run lint, and runs in the Coding Standards workflow only.

Testing

Existing tests pass.

Checklist

@n7studios n7studios self-assigned this Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant