WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 20 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:

Description

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 2 years ago.

Download all attachments as: .zip

Change History (6)

@Frank Klein
2 years ago

#1 @Frank Klein
2 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
2 years ago

  • Milestone changed from Awaiting Review to 5.0

#3 @boonebgorges
2 years ago

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

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

#4 @boonebgorges
2 years 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
20 months ago

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