WordPress / WordPress/Requests

Tests: Meta ticket for testing with external servers

Open
#687 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: testing/chores/QA
Dominant language
PHP
Stars
3.6k
Forks
500
Avg merge
2d 21h
Merged PRs (30d)
5

Description

There are several tickets open about tests using external servers/services and the fact that this means that those tests may fail on occation when the service is (temporarily) not available or when something changes in those endpoints.

This meta ticket is meant to bind those tickets together and to discuss the wider pespective of how to solve this.

Related tickets

Related tickets specific to tests with external services:
Related tickets specific to features which can't currently be tested:
Related tickets about documenting how to run the tests (locally with the test servers):

External services providing endpoints

Known external services which provide endpoints for testing status code and other HTTP(S) responses:

In addition to this, a local copy of the https://github.com/RequestsPHP/test-server code is being run to provide responses for some tests.

To discuss/investigate

  • Are there external services available for all needed endpoints ? I.e. can we abolish our dependency on the Heroku setup / test server repo ?
  • Can the tests be made more stable by switching to different services for certain tests ?
  • Can the tests be made more stable by having a helper function which will automatically retry a request a limited amount of times if it fails the first time ? (loosely related to feature request #222)
  • Can (some of) the tests be made more stable by having a fall-back URL ? I.e. if two different services both provide the response we need for the test, can a second server be tried if the request to the first server failed (via a helper function) ?
  • etc

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the related issues #315, #419, #496, #639, #7, and #475, along with pull request #668. Inspect the existing tests using requests-php-tests.herokuapp.com, httpbin.org, portquiz.net, and the local RequestsPHP/test-server copy. Done would require an agreed, stable approach for external-service test dependencies, retries, fallbacks, or replacements.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
networking, testing-qa
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.