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

Agree page to test #1

Closed
3 tasks done
eclarke1 opened this issue Jan 18, 2023 · 7 comments
Closed
3 tasks done

Agree page to test #1

eclarke1 opened this issue Jan 18, 2023 · 7 comments
Assignees
Labels
Automated Performance Testing Issues relating to Automated Performance Testing (WPP) type:enhancement New feature or request.

Comments

@eclarke1
Copy link

eclarke1 commented Jan 18, 2023

In order to conduct automated tests on WP Core, we need to agree on which theme or theme(s) to use, which page(s)/template(s) we will test, and what content should be loaded on those pages.

Acceptance

  • We have agreed on a theme
  • We have agreed on a page to test
  • We have agreed on what content to stage on the test page
@eclarke1 eclarke1 added the type:enhancement New feature or request. label Jan 18, 2023
@eclarke1 eclarke1 added the Automated Performance Testing Issues relating to Automated Performance Testing (WPP) label Jan 18, 2023
@adamsilverstein
Copy link
Collaborator

I propose we start with two pages:

@eclarke1 eclarke1 moved this from Backlog to Definition in Automated Performance Testing MVP Jan 26, 2023
@joemcgill
Copy link
Collaborator

I think the two pages @adamsilverstein identified are a good starting point. One question I have is whether we want to hard-pin our tests to a specific version of those themes to avoid variance due to code changes in those themes or if our tests should be inclusive of changes to those themes and always load the latest version?

Alternatives to consider:

  1. The new front-end tests added to the Gutenberg repo are using the "Hello World" page instead of the home page. While there is value in coordinating our use cases, I think the "Hello World" page is probably too basic of a use case to measure alone, since it only queries a single post and will not require querying any attachment metadata or rendering many complex blocks.

  2. For our server timing analysis, we want to identify a couple of different use cases that cover a range of common templates. For that effort, I was thinking we would target:

  • A homepage that includes a basic query loop — we'll need demo content for this)
  • A basic page — "Hello World" could work for this use case
  • A more complex post, including a featured image, several content images, and a range of other blocks — perhaps there is demo content we can use for this as well?

This might be too many use cases for an initial pass, but wanted to get us thinking about how we might build out these tests over time to cover more use cases.

@eclarke1
Copy link
Author

Assigning to @felixarntz and @adamsilverstein to kindly review comments here please.

@felixarntz
Copy link
Collaborator

@adamsilverstein @joemcgill I think for now going with the respective home page for 2023 and 2021 like @adamsilverstein is saying is a good start, to have a basic test for both block and classic themes.

Regarding the content though, I think it would be good to align the tests across the two themes to use rather similar content. For this first set of having only 1 test for each theme, I would suggest the following:

I think using similar content makes most sense, while of course keeping in mind that, to achieve a similar outcome, minor differences may be needed given how block themes and classic themes work differently.

Making sure that both test cases now display a list of latest posts also sets us up for a future like @joemcgill is saying: This first test could basically be our scenario "home page with posts list". For now it'd be the only one, but we could likely keep it as is later and just add more scenarios.

WDYT?

@joemcgill
Copy link
Collaborator

I agree that we can use the same test data for all tests. the wp-theme.com site uses the Theme Unit Test Data maintained by the Themes team (see more: https://developer.wordpress.org/themes/advanced-topics/theme-testing/). We'll need to add a step to our workflows to import the theme data before running the performance tests. I don't see prior art on any of the other repos, but we can probably use WP-CLI like this:

# Activate WP Importer plugin.
wp plugin install wordpress-importer --activate
# Don't know why, but failed importing directly.
wget https://raw.githubusercontent.com/WPTRT/theme-unit-test/master/themeunittestdata.wordpress.xml
# Import
wp import themeunittestdata.wordpress.xml --authors=create

One limitation to be aware of is that the theme test data does not currently get automatically updated as Gutenberg iterates on the way content is authored by the block editor, so there is a chance some markup introduced through a more recent version of the editor could affect our results. I don't think it's a major problem, just something to be aware of and maybe a future place where we can improve the overall tooling landscape for automating WP testing.

See: WordPress/theme-test-data#72

@eclarke1
Copy link
Author

eclarke1 commented Feb 3, 2023

@mukeshpanchal27 @joemcgill I see this issue is in progress but with Felix and Adam, could I ask who is actually working on this one please, and ask that assignees are kept accurate and up to date.

@joemcgill
Copy link
Collaborator

@eclarke1 Looks to me like we have alignment on the following:

We have agreed on a theme: Twenty Twenty Three (fully block theme) and Twenty Twenty One (classic theme)
We have agreed on a page to test: The homepage
We have agreed on what content to stage on the test page: Theme Unit test data.

There is no other work to be done here, so I'm going to mark this as resolved and reflect these decisions in the requirements for #4.

@github-project-automation github-project-automation bot moved this from In Progress to AC Review in Automated Performance Testing MVP Feb 3, 2023
@joemcgill joemcgill moved this from AC Review to Done in Automated Performance Testing MVP Feb 3, 2023
mukeshpanchal27 pushed a commit that referenced this issue Feb 9, 2023
The `$credentials['user_login']` and `$credentials['user_password']` parameters are passed by reference to the `wp_authenticate` action, and are at that point [https://www.php.net/manual/en/language.references.pass.php#124383 created as null] if they don't exist in the array.

This commit sets those values to an empty string, resolving two PHP 8.1 deprecation notices:
 * One from `preg_replace()` in `wp_strip_all_tags()` via `sanitize_user()` in `wp_authenticate()`:
{{{
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
}}}
 * One from `trim()` in `wp_authenticate()` itself:
{{{
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated
}}}

Includes documenting the `$credentials` parameter using hash notation.

Follow-up to [6643], [37697].

Props lenasterg, TobiasBg, ocean90, afragen, lkraav, SergeyBiryukov.
Fixes #56850.

git-svn-id: https://develop.svn.wordpress.org/trunk@55301 602fd350-edb4-49c9-b593-d223f7449a82
mukeshpanchal27 pushed a commit that referenced this issue Feb 27, 2023
…air screen.

The table is no longer created by core as of WordPress 3.0, and support for global terms was removed in WordPress 6.1, so `$wpdb->sitecategories` is unset by default.

This commit resolves a "passing null to non-nullable" deprecation notice on PHP 8.1:
{{{
Deprecated: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated in wp-includes/class-wpdb.php on line 1804
}}}

The `tables_to_repair` filter is available for plugins to readd the table or include any additional tables to repair.

Follow-up to [14854], [14880], [54240].

Props ipajen, chiragrathod103, SergeyBiryukov.
Fixes #57762.

git-svn-id: https://develop.svn.wordpress.org/trunk@55421 602fd350-edb4-49c9-b593-d223f7449a82
kt-12 pushed a commit that referenced this issue Sep 29, 2023
…om next_posts().

The `esc_url()` function expects to a string for `$url` parameter. There is no input validation within that function. The function contains a `ltrim()` which also expects a string. Passing `null` to this parameter results in `Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1+.

Tracing the stack back, a `null` is being passed to it within `next_posts()` when `get_next_posts_page_link()` returns `null` (it can return a string or `null`).

On PHP 7.0 to PHP 8.x, an empty string is returned from `esc_url()` when `null` is passed to it. The change in this changeset avoids the deprecation notice by not invoking `esc_url()` when `get_next_posts_page_link()` returns `null` and instead sets the `$output` to an empty string, thus maintain the same behavior as before (minus the deprecation notice).

Adds a test to validate an empty string is returned and the absence of the deprecation (when running on PHP 8.1+).

Follow-up to [11383], [9632].

Props codersantosh, nihar007, hellofromTonya, mukesh27, oglekler, rajinsharwar.
Fixes #59154.

git-svn-id: https://develop.svn.wordpress.org/trunk@56740 602fd350-edb4-49c9-b593-d223f7449a82
mukeshpanchal27 pushed a commit that referenced this issue Aug 28, 2024
…Info screen.

This resolves a fatal error if `strict_types` PHP setting is enabled:
{{{
Argument #1 ($num) must be of type float, string given
}}}

Since the goal of the Site Health Info screen is to display raw values where possible, the `number_format()` call here does not seem to provide any benefit.

Props krishneup, sabernhardt, audrasjb, SergeyBiryukov.
Fixes #60364.

git-svn-id: https://develop.svn.wordpress.org/trunk@58847 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automated Performance Testing Issues relating to Automated Performance Testing (WPP) type:enhancement New feature or request.
Projects
No open projects
Development

No branches or pull requests

4 participants