Skip to content
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

Add WordPress timing tests #4576

Open
schlessera opened this issue Apr 13, 2020 · 2 comments
Open

Add WordPress timing tests #4576

schlessera opened this issue Apr 13, 2020 · 2 comments
Labels
Accessibility Changes that impact accessibility and need corresponding review (e.g. markup changes). P2 Low priority Testing Issues related with Unit, E2E, Smoke, and other testing requirements/needs WS:Perf Work stream for Metrics, Performance and Optimizer

Comments

@schlessera
Copy link
Collaborator

Feature description

We don't have an obvious way right now to test anything that happens before the 'wp' hook, as we're using the WP_UnitTestCase. This leads to issues like the #4525 because we can never catch any timing problems that can happen before the 'wp' action.

It might be worthwhile to set up a separate set of tests that use SHORT_INIT or some other hack to achieve the same thing) to be able to test our plugin against WordPress, but control which actions happen and test for earlier conflicts.

This would also allow us to add regression tests to fixes like the one for the issue above, where we can only test manually right now.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Tests can run at an earlier action than 'wp'.
  • Tests still load the AMP plugin and any other additional extensions we need as required.

Implementation brief

  • Create a new TestCase implementation that loads WordPress via SHORT_INIT.
  • Add a mechanism to let the test choose at which action it wants to run, like a go_to_action() method.

QA testing instructions

Demo

Changelog entry

@schlessera schlessera added the Testing Issues related with Unit, E2E, Smoke, and other testing requirements/needs label Apr 13, 2020
@amedina amedina added Accessibility Changes that impact accessibility and need corresponding review (e.g. markup changes). P1 Medium priority labels Apr 13, 2020
@westonruter
Copy link
Member

We could also just empty out the $wp_actions array.

@schlessera
Copy link
Collaborator Author

That won't have the same effect, as the actions will already have run and modified all the globals. If we want to catch timing issues, we have to run the tests with the real setup. otherwise we're testing something irrelevant and meaningless.

@kmyram kmyram added the WS:Perf Work stream for Metrics, Performance and Optimizer label Aug 5, 2020
@westonruter westonruter added P2 Low priority and removed P1 Medium priority labels Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Changes that impact accessibility and need corresponding review (e.g. markup changes). P2 Low priority Testing Issues related with Unit, E2E, Smoke, and other testing requirements/needs WS:Perf Work stream for Metrics, Performance and Optimizer
Projects
Archived in project
Development

No branches or pull requests

4 participants