The idea behind the distributed hosting tests is to run WordPress’ automated test suite across a variety of hosting environments, to help verify that changes in WordPress don’t unintentionally affect hosts, and to help hosts be aware of how changes in WordPress or their environments affect how WordPress runs on their services.

Hosts that report receive automated emails when the tests are passing on WordPress.orgWordPress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/, but failing on their environment so that they can investigate.

Want to run the WordPress PHPUnit test suite on your own hosting infrastructure? Thank you; we look forward to seeing your results reported!

If you have questions about the process or run into test failures along the way, please open an issue in the project repository and we’ll help diagnose/get the documentation updated. Alternatively, you can also pop into the #hosting-community channel on WordPress.org Slack for help.

Setting Up

There are two primary steps in the setup process.

First, you’ll need to configure the phpunit-test-runner to run in a representative server environment. Read through the GitHub README for full configuration details. Notably:

  • The test runner can be driven from Travis CI or a cron job on the machine itself.
    • Eventually, we’d like to trigger the test runner for every commit. At this time, running it every 3-6 hours should be sufficient.
  • There are a variety of environment variables you can set to control the test runner’s behavior.

Second, once the test runner is passing all tests in your server environment, you can begin reporting results to WordPress.org. To do so:

  1. Create a bot WordPress.org account. If your company is Wonderful Hosting, Inc., this bot account username might be wonderfulbot. Make sure to set its email address to something monitored by a human — we’ll send an email when there’s a test failure. Please add a GravatarGravatar Is an acronym for Globally Recognized Avatar. It is the avatar system managed by WordPress.com, and used within the WordPress software. https://gravatar.com/./logo and URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org to the profile as well, to make it clear to users what hosting company is being represented in the results.
  2. Create a new issue in the phpunit-test-runner GitHubGitHub GitHub is a website that offers online implementation of git repositories that can can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ repo requesting your bot user to be added to this WordPress.org site as a “Test Reporter”. We’ll need the email address associated with the user in order to add them. Under the hood, we’re using a custom post typeCustom Post Type WordPress can hold and display many different types of content. A single item of such a content is generally called a post, although post is also a specific post type. Custom Post Types gives your site the ability to have templated posts, to simplify the concept. to log and display test results.
  3. After your bot user has been added to this WordPress.org site, you’ll be able to create an application password for your test runner. Sign into the WordPress.org site and navigate to Users -> Your Profile to generate the application password. Then, set the application password as an environment variable: export WPT_REPORT_API_KEY='wonderfulbot:Osho NHgM xYSY UWF9 qNUn YdjV'. Replace the characters after the colon with the application password for your bot user.

If all goes well, you’ll see your test results submitted at the end of php report.php:

The last line indicates your results have been successfully uploaded to the reporter website.