Make WordPress Core

Opened 5 weeks ago

Last modified 4 weeks ago

#62325 new defect (bug)

Ensure PHPUnit tests making network requests are in the external-http group.

Reported by: peterwilsoncc's profile peterwilsoncc Owned by:
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: needs-patch
Focuses: Cc:

Description

A number of tests in the PHPUnit test suite make network requests to ensure that features such as oembeds, DNS lookups and remote requests work as intended.

As these tests can be slow and are susceptible to failure in un-ideal network conditions, they ought to be in the external-http group to prevent false negatives when the developers run the test suite locally, especially within a virtual environment.

Some of these tests are missing the group, the purpose of this test is to review the test suite and ensure they are all in the external-http group.

cc @azaozz per discussion on PR#7655.

Change History (4)

#1 @peterwilsoncc
5 weeks ago

In 59326:

Tests/Build tools: Only fail importer tests if plugin is missing.

Reverts an earlier change to the test suite in which the PHPUnit tests could not run if the importer plugin was not available.

This update allows the test suite to run and will fail importer tests if the plugin is not available.

Follow up to r59085.

Props peterwilsoncc, azaozz.
See #62325.

#2 @peterwilsoncc
5 weeks ago

In 59327:

Tests/Build tools: Only fail importer tests if plugin is missing.

Reverts an earlier change to the test suite in which the PHPUnit tests could not run if the importer plugin was not available.

This update allows the test suite to run and will fail importer tests if the plugin is not available.

Follow up to r59085.

Merges [59326] to the 6.7 branch.

Props peterwilsoncc, azaozz.
See #62325.

#3 @peterwilsoncc
5 weeks ago

🤦‍♂️ The above commits has the incorrect ticket number, the were for #61530.

#4 @azaozz
4 weeks ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.8

Thanks for opening this ticket!

these tests can be slow and are susceptible to failure in un-ideal network conditions

Yep, thinking that fixing the group will be a nice improvement for most people that run the unit tests locally (the tests can be run with --exclude-group external-http when network connection is slow). Would probably be good to also add a reminder/docs to maintain that group when new tests are added.

Seems this can be done in 6.8. May also be a good-first-bug, perhaps.

Note: See TracTickets for help on using tickets.