Make WordPress Core

Opened 19 months ago

Closed 19 months ago

Last modified 9 months ago

#42903 closed enhancement (fixed)

Speed up tests for `wp_list_pages()`

Reported by: Frank Klein Owned by: boonebgorges
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:


The fixtures in Tests_List_Pages are (re)created in the setUp() method before every test run. Additionally, they rely on hardcoded post ids.

The attached patch uses shared fixtures, and dynamic data. It also contains smaller changes to get around having to align all variable declarations in a method, which looks weird.

Attachments (1)

42903.patch (39.1 KB) - added by Frank Klein 19 months ago.

Download all attachments as: .zip

Change History (6)

@Frank Klein
19 months ago

#1 @Frank Klein
19 months ago

  • Keywords has-patch added

#2 @SergeyBiryukov
19 months ago

  • Milestone changed from Awaiting Review to 5.0

#3 @boonebgorges
19 months ago

  • Owner set to boonebgorges
  • Status changed from new to reviewing

<3 - thanks so much for the patch, @Frank Klein.

#4 @boonebgorges
19 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 42402:

Improve performance of wp_list_pages() tests.

The changeset also removes the use of hardcoded post/author IDs.

Props frank-klein.
Fixes #42903.

#5 @jorbin
9 months ago

  • Milestone changed from 5.0 to 5.1
Note: See TracTickets for help on using tickets.