[wp-trac] [WordPress Trac] #42076: Allow the external HTTP tests to run internally

WordPress Trac noreply at wordpress.org
Tue Oct 3 16:44:28 UTC 2017


#42076: Allow the external HTTP tests to run internally
------------------------------+------------------------------
 Reporter:  johnbillion       |      Owner:
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:  needs-unit-tests
  Focuses:                    |
------------------------------+------------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42076>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list