Make WordPress Core

Opened 7 years ago

Last modified 4 years ago

#42076 new enhancement

Allow the external HTTP tests to run internally

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: needs-unit-tests
Focuses: Cc:

Description

The tests in the external-http group are the worst. They not only perform calls out over the internet, but they rely on a combination of wordpress.org, wordpress.com, example.org, example.com, and youtube.com.

The external oEmbed tests that use youtube.com (Tests_External_HTTP_OEmbed) can probably be removed. They're technically fragile (YouTube could change the structure of their embed URLs and cause the tests to fail) and don't actually test anything that core has control over.

It _should_ be possible to run the rest of the external-http tests against a local web server running PHP. As an example, frameworks such as Behat usually run against a server being run by PHP's built in web server.

If the test files from wordpress.com and wordpress.org were downloaded and placed into the test suite data directory, they could be served by a local web server and therefore tested without a remote HTTP request.

Spinning up a local web server in PHP could be made optional via a flag or an environment variable, and could be enabled on Travis by default.

It may even be that the functionality that is being tested by these external HTTP tests can be abstracted and made testable without performing an HTTP request at all, or it could be that the functionality is already covered by unit tests in the Requests framework.

Feedback / ideas welcome.

Change History (11)

#1 @johnbillion
7 years ago

In 41712:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

See #42076, #32714, #23149

#2 @SergeyBiryukov
4 years ago

In 47479:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.8 branch.
See #42076, #32714, #23149.

#3 @SergeyBiryukov
4 years ago

In 47480:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.7 branch.
See #42076, #32714, #23149.

#4 @SergeyBiryukov
4 years ago

In 47481:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.6 branch.
See #42076, #32714, #23149.

#5 @SergeyBiryukov
4 years ago

In 47482:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.5 branch.
See #42076, #32714, #23149.

#6 @SergeyBiryukov
4 years ago

In 47483:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.4 branch.
See #42076, #32714, #23149.

#7 @SergeyBiryukov
4 years ago

In 47484:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.3 branch.
See #42076, #32714, #23149.

#8 @SergeyBiryukov
4 years ago

In 47485:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.2 branch.
See #42076, #32714, #23149.

#9 @SergeyBiryukov
4 years ago

In 47486:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.1 branch.
See #42076, #32714, #23149.

#10 @SergeyBiryukov
4 years ago

In 47487:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.0 branch.
See #42076, #32714, #23149.

#11 @SergeyBiryukov
4 years ago

In 47488:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 3.9 branch.
See #42076, #32714, #23149.

Note: See TracTickets for help on using tickets.